This is all I got to go by:
2024-06-11 19:01:31 CREATE_STATE [
2024-06-11 19:01:31 {
2024-06-11 19:01:31 value: 'eyJyYW5kb20iOiJleWRJYS1CaFVocmtsMjQ2MkpKemViUmpnV0lTT2x2WmxDdjVJTHlvRzVzIn0',
2024-06-11 19:01:31 maxAge: 900
2024-06-11 19:01:31 }
2024-06-11 19:01:31 ]
2024-06-11 19:01:31 CREATE_PKCECODEVERIFIER [
2024-06-11 19:01:31 { value: 'zkAFnughK65TNAzcahaEub8KjCn5ln2eedYoepdxJLE', maxAge: 900 }
2024-06-11 19:01:31 ]
2024-06-11 19:01:31 authorization url is ready [
2024-06-11 19:01:31 {
2024-06-11 19:01:31 url: URL {
2024-06-11 19:01:31 href: 'http://keycloak.local/realms/webapp/protocol/openid-connect/auth?scope=openid+profile+email&response_type=code&client_id=webapp&redirect_uri=http%3A%2F%2Fwebapp.local%2Fauth%2Fcallback%2Fkeycloak&state=eyJyYW5kb20iOiJleWRJYS1CaFVocmtsMjQ2MkpKemViUmpnV0lTT2x2WmxDdjVJTHlvRzVzIn0&code_challenge=k9EVdVHZS9lni0U0iu3vdeTO5su51bXhNAcmMrRWjmE&code_challenge_method=S256',
2024-06-11 19:01:31 origin: 'http://keycloak.local',
2024-06-11 19:01:31 protocol: 'http:',
2024-06-11 19:01:31 username: '',
2024-06-11 19:01:31 password: '',
2024-06-11 19:01:31 host: 'keycloak.local',
2024-06-11 19:01:31 hostname: 'keycloak.local',
2024-06-11 19:01:31 port: '',
2024-06-11 19:01:31 pathname: '/realms/webapp/protocol/openid-connect/auth',
2024-06-11 19:01:31 search: '?scope=openid+profile+email&response_type=code&client_id=webapp&redirect_uri=http%3A%2F%2Fwebapp.local%2Fauth%2Fcallback%2Fkeycloak&state=eyJyYW5kb20iOiJleWRJYS1CaFVocmtsMjQ2MkpKemViUmpnV0lTT2x2WmxDdjVJTHlvRzVzIn0&code_challenge=k9EVdVHZS9lni0U0iu3vdeTO5su51bXhNAcmMrRWjmE&code_challenge_method=S256',
2024-06-11 19:01:31 searchParams: URLSearchParams {
2024-06-11 19:01:31 'scope' => 'openid profile email',
2024-06-11 19:01:31 'response_type' => 'code',
2024-06-11 19:01:31 'client_id' => 'webapp',
2024-06-11 19:01:31 'redirect_uri' => 'http://webapp.local/auth/callback/keycloak',
2024-06-11 19:01:31 'state' => 'eyJyYW5kb20iOiJleWRJYS1CaFVocmtsMjQ2MkpKemViUmpnV0lTT2x2WmxDdjVJTHlvRzVzIn0',
2024-06-11 19:01:31 'code_challenge' => 'k9EVdVHZS9lni0U0iu3vdeTO5su51bXhNAcmMrRWjmE',
2024-06-11 19:01:31 'code_challenge_method' => 'S256' },
2024-06-11 19:01:31 hash: ''
2024-06-11 19:01:31 },
2024-06-11 19:01:31 cookies: [ [Object], [Object] ],
2024-06-11 19:01:31 provider: {
2024-06-11 19:01:31 id: 'keycloak',
2024-06-11 19:01:31 name: 'Keycloak',
2024-06-11 19:01:31 type: 'oidc',
2024-06-11 19:01:31 style: [Object],
2024-06-11 19:01:31 clientId: 'webapp',
2024-06-11 19:01:31 clientSecret: 'MohY0/2zSQw/psWEnejC2ka3Al0oifvY4YjOkUaFfnI=',
2024-06-11 19:01:31 issuer: 'http://keycloak.local/realms/webapp',
2024-06-11 19:01:31 authorization: [Object],
2024-06-11 19:01:31 wellKnown: 'http://keycloak.local/realms/webapp/.well-known/openid-configuration',
2024-06-11 19:01:31 token: [Object],
2024-06-11 19:01:31 userinfo: [Object],
2024-06-11 19:01:31 signinUrl: 'http://webapp.local/auth/signin/keycloak',
2024-06-11 19:01:31 callbackUrl: 'http://webapp.local/auth/callback/keycloak',
2024-06-11 19:01:31 redirectProxyUrl: 'http://webapp.local/auth//callback/keycloak',
2024-06-11 19:01:31 checks: [Array],
2024-06-11 19:01:31 profile: [Function: C],
2024-06-11 19:01:31 account: [Function: I]
2024-06-11 19:01:31 }
2024-06-11 19:01:31 }
2024-06-11 19:01:31 ]
2024-06-11 19:01:44 callback route error details [
2024-06-11 19:01:44 {
2024-06-11 19:01:44 method: 'GET',
2024-06-11 19:01:44 query: {
2024-06-11 19:01:44 state: 'eyJyYW5kb20iOiJleWRJYS1CaFVocmtsMjQ2MkpKemViUmpnV0lTT2x2WmxDdjVJTHlvRzVzIn0',
2024-06-11 19:01:44 session_state: 'd0517a2f-75e6-4487-b787-c6ce126a961e',
2024-06-11 19:01:44 iss: 'http://keycloak.local/realms/webapp',
2024-06-11 19:01:44 code: '7f75a7d9-9d37-4a9c-b9d1-75f1e4391abf.d0517a2f-75e6-4487-b787-c6ce126a961e.61010cc3-48ae-401b-9764-e086e4b43814'
2024-06-11 19:01:44 },
2024-06-11 19:01:44 body: undefined
2024-06-11 19:01:44 }
2024-06-11 19:01:44 ]
2024-06-11 19:01:39 env-url-basepath-redundant []
2024-06-11 19:01:44 a: Read more at https://errors.authjs.dev#callbackrouteerror
2024-06-11 19:01:44 at is (/app/.next/server/chunks/428.js:393:38923)
2024-06-11 19:01:44 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-06-11 19:01:44 at async im (/app/.next/server/chunks/428.js:393:45531)
2024-06-11 19:01:44 at async ig (/app/.next/server/chunks/428.js:393:50443)
2024-06-11 19:01:44 at async /app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:42484
2024-06-11 19:01:44 at async eI.execute (/app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:32486)
2024-06-11 19:01:44 at async eI.handle (/app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:43737)
2024-06-11 19:01:44 at async doRender (/app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/base-server.js:1317:42)
2024-06-11 19:01:44 at async cacheEntry.responseCache.get.routeKind (/app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/base-server.js:1539:28)
2024-06-11 19:01:44 at async NextNodeServer.renderToResponseWithComponentsImpl (/app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/server/base-server.js:1447:28) {
2024-06-11 19:01:44 type: 'CallbackRouteError',
2024-06-11 19:01:44 kind: 'error',
2024-06-11 19:01:44 [cause]: {
2024-06-11 19:01:44 err: TypeError: fetch failed
2024-06-11 19:01:44 at node:internal/deps/undici/undici:12502:13
2024-06-11 19:01:44 at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
2024-06-11 19:01:44 at async globalThis.fetch (/app/.next/server/chunks/675.js:1:36483)
2024-06-11 19:01:44 at async t2 (/app/.next/server/chunks/428.js:393:27136)
2024-06-11 19:01:44 at async is (/app/.next/server/chunks/428.js:393:34159)
2024-06-11 19:01:44 at async im (/app/.next/server/chunks/428.js:393:45531)
2024-06-11 19:01:44 at async ig (/app/.next/server/chunks/428.js:393:50443)
2024-06-11 19:01:44 at async /app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:42484
2024-06-11 19:01:44 at async eI.execute (/app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:32486)
2024-06-11 19:01:44 at async eI.handle (/app/node_modules/.pnpm/next@14.1.4_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js:6:43737) {
2024-06-11 19:01:44 [cause]: [Error]
2024-06-11 19:01:44 },
2024-06-11 19:01:44 errno: -3001,
2024-06-11 19:01:44 code: 'EAI_AGAIN',
2024-06-11 19:01:44 syscall: 'getaddrinfo',
2024-06-11 19:01:44 hostname: 'keycloak.local',
2024-06-11 19:01:44 provider: 'keycloak'
2024-06-11 19:01:44 }
What weird is when you try to login the session gets created in keycloak so I’m trying to figure out if its a keycloak issue or a authjs issue.
I’ve gotten in contact with the authjs team but they keep saying its a configuration issue: AuthJS do not redirect to set URL, instead it redirect to Docker container internal IP · nextauthjs/next-auth · Discussion #8449 · GitHub
Thanks.