Skip to content

Commit d5b74e8

Browse files
committed
fix step-up auth to work with python too
1 parent ee9015e commit d5b74e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/scenarios/client/auth/scope-handling.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,12 @@ export class ScopeStepUpAuthScenario implements Scenario {
347347

348348
if (!hasRequiredScopes) {
349349
// Has token but insufficient scopes - return 403
350+
// Per RFC 6750 Section 3, must include error in WWW-Authenticate header
350351
return res
351352
.status(403)
352353
.set(
353354
'WWW-Authenticate',
354-
`Bearer scope="${requiredScopes.join(' ')}", resource_metadata="${resourceMetadataUrl()}"`
355+
`Bearer error="insufficient_scope", error_description="Token has insufficient scope", scope="${requiredScopes.join(' ')}", resource_metadata="${resourceMetadataUrl()}"`
355356
)
356357
.json({
357358
error: 'insufficient_scope',

0 commit comments

Comments
 (0)