OIDC/Authentik configuration issues

I am having issues getting the OIDC integration working with my Authentik setup. Configurations is as follows Homarr:
services:
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
volumes:
- /media/homarr/configs:/app/data/configs
- /media/homarr/icons:/app/public/icons
- /media/homarr/data:/data
ports:
- 7575:7575
environment:
BASE_URL: home.mydomain.com
AUTH_PROVIDER: credentials,oidc
AUTH_OIDC_URI: https://auth.mydomain.com/application/o/homarr/.well-known/openid-configuration
AUTH_OIDC_CLIENT_SECRET: SECRET
AUTH_OIDC_CLIENT_ID: ID
AUTH_OIDC_CLIENT_NAME: Authentik
AUTH_OIDC_AUTO_LOGIN: false
networks: {}
services:
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
volumes:
- /media/homarr/configs:/app/data/configs
- /media/homarr/icons:/app/public/icons
- /media/homarr/data:/data
ports:
- 7575:7575
environment:
BASE_URL: home.mydomain.com
AUTH_PROVIDER: credentials,oidc
AUTH_OIDC_URI: https://auth.mydomain.com/application/o/homarr/.well-known/openid-configuration
AUTH_OIDC_CLIENT_SECRET: SECRET
AUTH_OIDC_CLIENT_ID: ID
AUTH_OIDC_CLIENT_NAME: Authentik
AUTH_OIDC_AUTO_LOGIN: false
networks: {}
Authentik: Redirect URI: https://home.mydomain.com/api/auth/callback/oidc (Everything else default) When I try to use the OAUTH Login i get redirected to: http://localhost:7575/api/auth/error?error=OAuthSignin Which seems odd? Logs are as follows:
homarr | [next-auth][error][SIGNIN_OAUTH_ERROR]
homarr | https://next-auth.js.org/errors#signin_oauth_error expected 200 OK, got: 404 Not Found {
homarr | error: {
homarr | message: 'expected 200 OK, got: 404 Not Found',
homarr | stack: 'OPError: expected 200 OK, got: 404 Not Found\n' +
homarr | ' at processResponse (/app/node_modules/openid-client/lib/helpers/process_response.js:41:11)\n' +
homarr | ' at Issuer.discover (/app/node_modules/openid-client/lib/issuer.js:152:20)\n' +
homarr | ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
homarr | ' at async openidClient (/app/node_modules/next-auth/core/lib/oauth/client.js:16:14)\n' +
homarr | ' at async getAuthorizationUrl (/app/node_modules/next-auth/core/lib/oauth/authorization-url.js:70:18)\n' +
homarr | ' at async Object.signin (/app/node_modules/next-auth/core/routes/signin.js:38:24)\n' +
homarr | ' at async AuthHandler (/app/node_modules/next-auth/core/index.js:260:26)\n' +
homarr | ' at async NextAuthApiHandler (/app/node_modules/next-auth/next/index.js:22:19)\n' +
homarr | ' at async auth (/app/.next/server/pages/api/auth/[...nextauth].js:143:12)',
homarr | name: 'OPError'
homarr | },
homarr | providerId: 'oidc',
homarr | message: 'expected 200 OK, got: 404 Not Found'
homarr | }
homarr | [next-auth][error][SIGNIN_OAUTH_ERROR]
homarr | https://next-auth.js.org/errors#signin_oauth_error expected 200 OK, got: 404 Not Found {
homarr | error: {
homarr | message: 'expected 200 OK, got: 404 Not Found',
homarr | stack: 'OPError: expected 200 OK, got: 404 Not Found\n' +
homarr | ' at processResponse (/app/node_modules/openid-client/lib/helpers/process_response.js:41:11)\n' +
homarr | ' at Issuer.discover (/app/node_modules/openid-client/lib/issuer.js:152:20)\n' +
homarr | ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
homarr | ' at async openidClient (/app/node_modules/next-auth/core/lib/oauth/client.js:16:14)\n' +
homarr | ' at async getAuthorizationUrl (/app/node_modules/next-auth/core/lib/oauth/authorization-url.js:70:18)\n' +
homarr | ' at async Object.signin (/app/node_modules/next-auth/core/routes/signin.js:38:24)\n' +
homarr | ' at async AuthHandler (/app/node_modules/next-auth/core/index.js:260:26)\n' +
homarr | ' at async NextAuthApiHandler (/app/node_modules/next-auth/next/index.js:22:19)\n' +
homarr | ' at async auth (/app/.next/server/pages/api/auth/[...nextauth].js:143:12)',
homarr | name: 'OPError'
homarr | },
homarr | providerId: 'oidc',
homarr | message: 'expected 200 OK, got: 404 Not Found'
homarr | }
Anyone able to point me in the right direction? I am stumped
Solution:
See my edits to your config below: `services: homarr: container_name: homarr...
Jump to solution
9 Replies
Cakey Bot
Cakey Bot2mo ago
Thank you for submitting a support request. Depending on the volume of requests, our team should get in contact with you shortly.
⚠️ Please include the following details in your post or we may reject your request without further comment: - Log (See https://homarr.dev/docs/community/faq#how-do-i-open-the-console--log) - Operating system (Unraid, TrueNAS, Ubuntu, ...) - Exact Homarr version (eg. 0.15.0, not latest) - Configuration (eg. docker-compose, screenshot or similar. Use ``your-text`` to format) - Other relevant information (eg. your devices, your browser, ...)
❓ Frequently Asked Questions | Homarr documentation
Can I install Homarr on a Raspberry Pi?
Tag
Tag2mo ago
Set NEXTAUTH_URL env var to your homarr address
philskents
philskents2mo ago
Good news, it no longer redirects to localhost. Bad news, it still doesn't work and I get this error:
homarr | [next-auth][error][SIGNIN_OAUTH_ERROR]
homarr | https://next-auth.js.org/errors#signin_oauth_error expected 200 OK, got: 404 Not Found {
homarr | error: {
homarr | message: 'expected 200 OK, got: 404 Not Found',
homarr | stack: 'OPError: expected 200 OK, got: 404 Not Found\n' +
homarr | ' at processResponse (/app/node_modules/openid-client/lib/helpers/process_response.js:41:11)\n' +
homarr | ' at Issuer.discover (/app/node_modules/openid-client/lib/issuer.js:152:20)\n' +
homarr | ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
homarr | ' at async openidClient (/app/node_modules/next-auth/core/lib/oauth/client.js:16:14)\n' +
homarr | ' at async getAuthorizationUrl (/app/node_modules/next-auth/core/lib/oauth/authorization-url.js:70:18)\n' +
homarr | ' at async Object.signin (/app/node_modules/next-auth/core/routes/signin.js:38:24)\n' +
homarr | ' at async AuthHandler (/app/node_modules/next-auth/core/index.js:260:26)\n' +
homarr | ' at async NextAuthApiHandler (/app/node_modules/next-auth/next/index.js:22:19)\n' +
homarr | ' at async auth (/app/.next/server/pages/api/auth/[...nextauth].js:143:12)',
homarr | name: 'OPError'
homarr | },
homarr | providerId: 'oidc',
homarr | message: 'expected 200 OK, got: 404 Not Found'
homarr | }
homarr | [next-auth][error][SIGNIN_OAUTH_ERROR]
homarr | https://next-auth.js.org/errors#signin_oauth_error expected 200 OK, got: 404 Not Found {
homarr | error: {
homarr | message: 'expected 200 OK, got: 404 Not Found',
homarr | stack: 'OPError: expected 200 OK, got: 404 Not Found\n' +
homarr | ' at processResponse (/app/node_modules/openid-client/lib/helpers/process_response.js:41:11)\n' +
homarr | ' at Issuer.discover (/app/node_modules/openid-client/lib/issuer.js:152:20)\n' +
homarr | ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
homarr | ' at async openidClient (/app/node_modules/next-auth/core/lib/oauth/client.js:16:14)\n' +
homarr | ' at async getAuthorizationUrl (/app/node_modules/next-auth/core/lib/oauth/authorization-url.js:70:18)\n' +
homarr | ' at async Object.signin (/app/node_modules/next-auth/core/routes/signin.js:38:24)\n' +
homarr | ' at async AuthHandler (/app/node_modules/next-auth/core/index.js:260:26)\n' +
homarr | ' at async NextAuthApiHandler (/app/node_modules/next-auth/next/index.js:22:19)\n' +
homarr | ' at async auth (/app/.next/server/pages/api/auth/[...nextauth].js:143:12)',
homarr | name: 'OPError'
homarr | },
homarr | providerId: 'oidc',
homarr | message: 'expected 200 OK, got: 404 Not Found'
homarr | }
Tag
Tag2mo ago
One of the urls are wrong. Check on other threads about Authentik to see what others might have done (the search function of discord should be good enough here)
Solution
AJ
AJ2mo ago
See my edits to your config below: services: homarr: container_name: homarr image: ghcr.io/ajnart/homarr:latest restart: unless-stopped volumes: - /media/homarr/configs:/app/data/configs - /media/homarr/icons:/app/public/icons - /media/homarr/data:/data ports: - 7575:7575 environment: BASE_URL: home.mydomain.com NEXTAUTH_URL: home.mydomain.com NEXTAUTH_SECRET: RANDOM488383!!@ AUTH_PROVIDER: credentials,oidc AUTH_OIDC_URI: https://home.mydomain.com/application/o/homarr AUTH_OIDC_CLIENT_SECRET: SECRET AUTH_OIDC_CLIENT_ID: ID AUTH_OIDC_CLIENT_NAME: Authentik AUTH_OIDC_ADMIN_GROUP: authentik Admins AUTH_OIDC_OWNER_GROUP: authentik Admins networks: {}
AJ
AJ2mo ago
Make sure your REdirect URI in your Authentik provider is your.homarr.domain.com/api/auth/callback/oidc Also make sure the user you're using is added to the groups you define for users/admins
AJ
AJ2mo ago
Here's my Authentik config:
No description
philskents
philskents2mo ago
That works, thanks!
AJ
AJ2mo ago
You're very welcome