Skip to content

Commit

Permalink
feat: explicitly add dpop_jkt to par request when using dpop
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed May 5, 2022
1 parent f7c1f38 commit e6acd99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1388,6 +1388,7 @@ export async function pushedAuthorizationRequest(

if (options?.DPoP !== undefined) {
await dpopProofJwt(headers, options.DPoP, url, 'POST')
body.set('dpop_jkt', await calculateJwkThumbprint(options?.DPoP.publicKey))
}

return authenticatedRequest(as, client, 'POST', url, body, headers, options)
Expand Down
2 changes: 1 addition & 1 deletion test/par.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ test('pushedAuthorizationRequest() w/ DPoP', async (t) => {
dpop: /.+/,
},
body(body) {
return new URLSearchParams(body).get('client_id') === client.client_id
return new URLSearchParams(body).has('dpop_jkt')
},
})
.reply(200, { request_uri: 'urn:example:uri', expires_in: 60 })
Expand Down

0 comments on commit e6acd99

Please sign in to comment.