Unable to complete OAuth login - Immich & Authentik

Hi!

So I'm setting up OAuth login. I'm using Authentik. I created an OAuth2/OpenID Provider and Application using the docs.
The button to login with OAuth shows up and I get redirected correctly to Authentik. I'm prompted for my username, password, then a consent screen for using my email.. I'm then redirected back to Immich and the URL changes <immich>/auth/login?code=xxxxxx&state=xxxxxxxxx But then the login fails, I'm back at the Immich login and the text "Unable to complete OAuth login" appears.

I found the following error in the Immich server log:

[Nest] 7  - 12/21/2022, 6:37:04 PM   ERROR [ExceptionsHandler] outgoing request timed out after 3500ms
RPError: outgoing request timed out after 3500ms
    at /usr/src/app/node_modules/openid-client/lib/helpers/request.js:137:13
    at async Client.grant (/usr/src/app/node_modules/openid-client/lib/client.js:1316:22)
    at async Client.callback (/usr/src/app/node_modules/openid-client/lib/client.js:476:24)
    at async OAuthService.callback (/usr/src/app/dist/apps/immich/apps/immich/src/api-v1/oauth/oauth.service.js:46:24)
    at async OAuthController.callback (/usr/src/app/dist/apps/immich/apps/immich/src/api-v1/oauth/oauth.controller.js:33:31)
    at async /usr/src/app/node_modules/@nestjs/core/router/router-execution-context.js:46:28
    at async /usr/src/app/node_modules/@nestjs/core/router/router-proxy.js:9:17

I can't figure out why there is a time out and at what part of the login flow. Is it a connection / firewall issue?
Was this page helpful?