Problems with Authentik integration #498
|
Hello, I have set up my Mail-Archiver to login through OIDC with Authentik. This is my Docker Compose configuration. When logging in, I see this error in the Mail-Archiver log: Is my configuration wrong? The error seem on the Mail-Archiver side. |
Replies: 3 comments 3 replies
|
The error is being thrown by Mail-Archiver, but the root cause is Authentik not returning a required claim (typically When ASP.NET Core processes the OIDC token/userinfo ( Here is how to fix it: 1. Enable Property Mappings in AuthentikAuthentik won't include email or profile claims unless the corresponding Property Mappings are explicitly assigned to the OIDC Provider:
2. Check OIDC Scopes in Docker ComposeEnsure Mail-Archiver is actually requesting the required scopes ( environment:
- OIDC_SCOPES=openid profile email3. Verify User Email in AuthentikMake sure the user account you are testing with actually has an Email address set in Authentik ( Once you attach those property mappings in Authentik, clear your browser cookies/session and try logging in again! Finally mark me as correct :) |
|
Everything was set correctly, except for the scopes. I have added these environment variables, but I still get this error:
|
|
Are you a bot? |

Thanks for the screenshot! Seeing that the scopes (
openid,email,profile) are properly assigned in Authentik narrows down the issue significantly.Since the stack trace shows the exception inside
RunUserInformationReceivedEventAsync, ASP.NET Core successfully called Authentik's/userinfoendpoint, but Mail-Archiver is throwingMissingClaimExceptionbecause one specific required claim is still missing from the returned JSON payload.Here are the 4 main reasons this happens with Authentik and how to solve it:
1. Empty User Profile Fields in Authentik
Even with the
emailandprofilemappings attached, if the test user in Authentik has an empty Email or empty Name/Username field in their pro…