fix(oidc): end-session 이 만료 id_token_hint 를 수용 (RP-Initiated Logout §2) - #79
Merged
Merged
Conversation
verifyIdToken 에 ignoreExpiry 옵션이 이미 있으나 end-session GET/POST 가 넘기지 않아 만료 토큰이 invalid_id_token_hint 로 거부됨. 스펙상 id_token_hint 는 만료돼도 유효한 힌트이므로 ignoreExpiry:true 전달. 서명/issuer/sub/aud/events 검증은 유지 — 만료 검사만 무시. 통합 테스트(end-session.test.ts) 추가: 만료 힌트 수용(GET/POST) 및 서명 위조·issuer 불일치·sub 불일치·aud 불일치·BC logout token 거부 유지 검증. Co-Authored-By: Claude Fable 5 <[email protected]>
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.
요약
GET/POST /oidc/end-session이 만료된id_token_hint를 거부해 정상 로그아웃이400 {"error":"invalid_id_token_hint"}로 실패하는 버그 수정.OIDC RP-Initiated Logout 1.0 §2 는
id_token_hint가 만료된 ID Token 이어도 됨(MAY be expired)을 명시하고, 만료만을 이유로 요청을 거부해서는 안 된다고 규정한다.verifyIdToken에는 정확히 이 용도의ignoreExpiry옵션이 이미 존재했으나(주석에도 명시), end-session 의 두 호출부가 넘기지 않아 발생한 누락이다.실제 증상: id_token TTL(약 10분) 초과 후 RP 가 로그인 시점 id_token 을 hint 로 로그아웃 요청 → 항상 400. RP 로컬 세션만 지워지고 IdP SSO 세션은 남는 "부분 로그아웃" 상태 발생.
변경 내용
src/routes/oidc/end-session/+server.ts— GET/POST 두verifyIdToken호출부에ignoreExpiry: true추가. 만료 검사만 무시하고 나머지 방벽은 전부 유지:expectedIssuer일치sub와 현재 세션 사용자 일치client_id명시 시aud일치eventsclaim 보유 토큰(BC logout token) 거부 — type-confusion 방어verifyIdToken의 기본 동작(옵션 없을 때 만료 거부)은 변경 없음. 다른 사용처(introspection 등)에는 전파하지 않음.테스트
test/integration/end-session.test.ts신규 (실 DB 하네스, 7케이스):post_logout_redirect_uri로 302 (state 전파), 세션 revoke 확인test/unit/crypto-keys.test.ts케이스가 커버전체 스위트 233/233 통과,
bun run check0 errors, prettier/eslint 통과.🤖 Generated with Claude Code