msgbyte / msgbyte/tianji

Error when login with oauth custom provider

Open
#159 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.1k
Forks
194
Avg merge
18m
Merged PRs (30d)
3

Description

Docker Compose file configuration:

AUTH_CUSTOM_NAME: Custom
AUTH_CUSTOM_TYPE: oauth
AUTH_CUSTOM_ISSUR: https://mydomain.tld/application/o/tianji/.well-known/openid-configuration
AUTH_CUSTOM_ISSUER: https://mydomain.tld/application/o/tianji/.well-known/openid-configuration
AUTH_CUSTOM_ID: MY_ID
AUTH_CUSTOM_SECRET: MY_SECRET

Logs:

tianji-1    | [auth][error] OperationProcessingError: "response" is not a conform Authorization Server Metadata response
tianji-1    |     at Module.processDiscoveryResponse (file:///app/tianji/node_modules/.pnpm/oauth4webapi@2.11.1/node_modules/oauth4webapi/build/index.js:233:15)
tianji-1    |     at getAuthorizationUrl (file:///app/tianji/node_modules/.pnpm/@auth+core@0.34.1_nodemailer@6.9.8/node_modules/@auth/core/lib/actions/signin/authorization-url.js:19:28)
tianji-1    |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
tianji-1    |     at async Module.signIn (file:///app/tianji/node_modules/.pnpm/@auth+core@0.34.1_nodemailer@6.9.8/node_modules/@auth/core/lib/actions/signin/index.js:10:56)
tianji-1    |     at async AuthInternal (file:///app/tianji/node_modules/.pnpm/@auth+core@0.34.1_nodemailer@6.9.8/node_modules/@auth/core/lib/index.js:60:24)
tianji-1    |     at async Auth (file:///app/tianji/node_modules/.pnpm/@auth+core@0.34.1_nodemailer@6.9.8/node_modules/@auth/core/index.js:109:34)
tianji-1    |     at async file:///app/tianji/node_modules/.pnpm/@auth+express@0.5.6_express@4.18.2_nodemailer@6.9.8/node_modules/@auth/express/index.js:141:45
tianji-1    | POST /api/auth/signin/custom 200 - - 167.333 ms
tianji-1    | Error: user.info TRPCError: No Token or Session
tianji-1    |     at file:///app/tianji/src/server/dist/src/server/trpc/trpc.js:90:11
tianji-1    |     at async callRecursive (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)
tianji-1    |     at async file:///app/tianji/src/server/dist/src/server/trpc/trpc.js:30:21
tianji-1    |     at async callRecursive (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:143:24)
tianji-1    |     at async procedure (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/procedureBuilder.mjs:176:24)
tianji-1    |     at async file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveResponse.mjs:249:30
tianji-1    |     at async Promise.all (index 0)
tianji-1    |     at async resolveResponse (file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/resolveResponse.mjs:488:26)
tianji-1    |     at async file:///app/tianji/node_modules/.pnpm/@trpc+server@11.0.0-rc.648_typescript@5.7.2/node_modules/@trpc/server/dist/adapters/node-http/nodeHTTPRequestHandler.mjs:70:34 {
tianji-1    |   cause: undefined,
tianji-1    |   code: 'UNAUTHORIZED'
tianji-1    | }
tianji-1    | GET /api/auth/error?error=Configuration 500 - - 3.953 ms
tianji-1    | GET /trpc/user.info?batch=1&input=%7B%7D 401 - - 3.914 ms

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with the supplied Docker Compose OAuth configuration and inspect the custom provider's discovery-response handling around the reported authorization flow. Compare the configured issuer metadata response with the expected Authorization Server Metadata, then verify that sign-in completes without the Configuration and unauthorized-session errors shown in the logs.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker-compose, typescript
Domain
authentication, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.