-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Overview
Add conformance tests for OAuth scope selection strategies and scope challenge handling in client authentication flows.
Specification References
Key Requirements from Specification
Scope Selection (SHOULD)
- Clients SHOULD follow principle of least privilege
- Clients SHOULD use
scopeparameter fromWWW-Authenticateheader if provided - If
scopenot available, use all scopes fromscopes_supportedin Protected Resource Metadata - Omit
scopeparameter ifscopes_supportedis undefined
Scope Challenge Handling
- Servers SHOULD respond with HTTP 403 for insufficient scope errors
- Servers SHOULD include
WWW-Authenticateheader witherror="insufficient_scope" - Servers SHOULD include
scopeparameter with required scopes - Clients SHOULD respond by requesting new token with increased scopes via step-up authorization
- Clients SHOULD implement retry limits for scope upgrade attempts
401 Handling on Non-Initialize (MUST)
- Clients MUST parse
WWW-Authenticateheaders - Clients MUST respond appropriately to HTTP 401 responses
- Authorization MUST be included in every HTTP request
Scenarios to Cover
Positive Tests
- Client correctly uses scope from
WWW-Authenticateheader - Client falls back to
scopes_supportedwhen scope not in header - Client handles HTTP 403 with
insufficient_scopeerror - Client performs step-up authorization flow successfully
- Client handles 401 on non-initialize requests
Negative Tests
- Client fails to include scope from
WWW-Authenticateheader - Client requests excessive scopes beyond what's needed
- Client doesn't retry after
insufficient_scopeerror - Client enters infinite retry loop on scope challenges
- Client fails to handle 401 on non-initialize requests
Implementation Notes
- Register spec references in
src/scenarios/client/auth/spec-references.ts - Build on existing auth scenarios in
src/scenarios/client/auth/ - Follow patterns from
basic-dcr.tsandbasic-metadata.ts - Include at least one negative test scenario per requirement
Acceptance Criteria
- Test scenarios cover scope selection strategy per spec
- Test scenarios cover scope challenge handling per spec
- Tests validate 401 response handling on non-initialize requests
- Tests verify client can complete scope challenge flow
- At least one negative test included for each major requirement
- Spec references registered in check definitions file
- All checks properly documented and follow existing patterns
Metadata
Metadata
Assignees
Labels
No labels