Having an issue getting new auth system working when accessing HA externally via nginx.
When accessed locally the following appears which indicates auth loaded correctly:
I’ve had a look in chrome console while loading ha.mydomain.com. I see the following error:
Failed to load https://[redacted].cloudflareaccess.com/cdn-cgi/access/login/ha.[redacted].com?kid=redacted&redirect_url=%2Fauth%2Fproviders: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://ha.[redacted].com' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
I should have posted my confg yaml. Here’s the relevant parts:
Tried that but it hasn’t resolved the issue.
After that change I see an additional two warnings in chrome console:
The FetchEvent for "https://ha.mydomain.com/auth/providers" resulted in a network error response: an "opaqueredirect" type response was used for a request whose redirect mode is not "manual".
Cross-Origin Read Blocking (CORB) blocked cross-origin response https://[redacted].cloudflareaccess.com/cdn-cgi/access/login/ha.mydomain.com?kid=redacted&redirect_url=%2Fauth%2Fproviders with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.
Cloudflare supports CORS and operates in the following way:
The Cloudflare CDN identifies cache items based on the Host Header + Origin Header + Path and Query, which supports different objects using the same host header, but different origin headers
Cloudflare passes Access-Control-Allow-Origin header through unaltered from the origin server to the browser
https://…/auth/providers is the url we returned list of available authentication provider to “client”, HA frontend web is one of our “client”, we also has others likes iOS app etc.