Repository navigation
fix(auth-client): ID トークンに email を求めず、本物の accounts でログインできるようにする - #24
Merged
Merged
Conversation
lumorphia/accounts (Better Auth 1.7.7 の oauth-provider) は、アクセストークンを出すときは email などの標準の claim を ID トークンに入れず、UserInfo でだけ返す (OIDC Core 5.4)。 auth-client は ID トークンの email と email_verified を必須にしていたので、本物の accounts を 相手にすると callback で必ず `Invalid Lumorphia claim string` になった。テストの発行元も ID トークンに email を入れていて、ずれに気づけなかった。 ID トークンでの email の検査をやめ、UserInfo の email・email_verified の検査 (もとからある) に 任せる。テストの発行元は本物と同じく ID トークンに email を入れない形にし、email が無い・ email_verified が無い UserInfo を拒むことを確かめる。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
手元で Prismtone から本物の lumorphia/accounts に「Lumorphia でログイン」したら、callback で
Invalid Lumorphia claim stringになり、ログインできなかった。原因
createIdTokenは標準の claim をID_TOKEN_SCOPE_CLAIM_GUARDSで undefined にし、標準の claim を作るuserNormalClaimsは UserInfo の応答でだけ使うemailとemail_verifiedを必須にしていた (claimString(payload.email))変更
検証
公開 (1.1.1) のあとで、prismtone の版を上げ、
e2e/mock-lumorphia.tsも ID トークンに email を入れない形にする。🤖 Generated with Claude Code