OIDC Authentik Issue - {"error":"Failed to initiate OIDC login","message":"fetch failed"}
Hello,
im receiving the following error while configuring the OIDC feature:
{"error":"Failed to initiate OIDC login","message":"fetch failed"}
Sadly nothing else is shown in the container logs except:
OIDC login initiation failed: fetch failed
The URL of my Authentik Instance is reachable from the container and the certificate is also not a problem. The Browser itself only shows an 500 Error on the /api/auth/oidc/login Path and there is no Request going out to Authentik.
Is there a way to enable debug logging to get more information here ? There other question is if it is enough to add the root ca to the system store of the container or if there is a seperate setting for that
Also im assuming that /api/auth/oidc/callback is the correct redirect Path
Thanks for the detailed report. /api/auth/oidc/callback is the correct redirect path.
"fetch failed" is Node hiding the real error. #82 (shipping in v1.8.7) logs the underlying cause, e.g. UNABLE_TO_VERIFY_LEAF_SIGNATURE, ENOTFOUND or ECONNREFUSED, and includes the code in the error response.
With a private root CA, adding it to the container's system store won't help: Node doesn't read the OS certificate store. Mount the CA and point NODE_EXTRA_CA_CERTS at it instead:
environment:
- NODE_EXTRA_CA_CERTS=/certs/root-ca.pem
volumes:
- ./root-ca.pem:/certs/root-ca.pem:ro
It has to be set in the container environment (not the .env file, which is read after Node has loaded its CAs), and the container needs a restart. If it still fails after that, please paste the new log line with the cause code.