OAUTH with Authentik - user invalid! #6974
-
|
I've spent quite a bit of time trying to figure out why I cannot get TriliumNext to work with Authentik. All my settings seem right, from checking the docs to viewing many other peoples configurations and even trying to go back and forth with AI. Issue: Configuration: Authentik: Logs: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Hi @Warrior01017! I'm Dosu and I’m helping the Trilium team. The "user invalid!" and 502 Bad Gateway errors with Authentik OAUTH in TriliumNext are most often caused by either missing user claims in the ID token or proxy misconfiguration. First, make sure your Nginx Proxy Manager config increases buffer sizes—users have fixed 502 errors by setting Next, double-check that your Authentik provider is set to include the Also, confirm your environment variables are spelled correctly and match the Authentik provider config. The most critical are:
Restart the Trilium container after any changes. If you're behind a reverse proxy, set If everything looks correct but you still get "user invalid!", check the Trilium logs for details about missing claims or token validation errors. Sometimes, logging in twice is needed for the first OAuth user creation source. Let me know if you want more targeted troubleshooting steps! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
OMG!! Adding those buffer size increases to NPM fixed it! I cannot believe that was the issue and nothing else pointed me there. However, I am now have the same issue as this, but at least I can log in now with Authentik. |
Beta Was this translation helpful? Give feedback.
Hi @Warrior01017! I'm Dosu and I’m helping the Trilium team.
The "user invalid!" and 502 Bad Gateway errors with Authentik OAUTH in TriliumNext are most often caused by either missing user claims in the ID token or proxy misconfiguration.
First, make sure your Nginx Proxy Manager config increases buffer sizes—users have fixed 502 errors by setting
proxy_buffers 16 16k; proxy_buffer_size 32k; proxy_busy_buffers_size 64k;in the location block for TriliumNext. This prevents "upstream sent too big header" errors when handling large OAUTH tokens source.Next, double-check that your Authentik provider is set to include the
openid profile emailscopes and that "Include claims in id_token" is e…