deno.land / x / oauth4webapi@v1.2.2 / examples / fapi2-message-signing.diff

fapi2-message-signing.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff --git a/examples/fapi2.ts b/examples/fapi2-message-signing.tsindex 3717f77..8897055 100644--- a/examples/fapi2.ts+++ b/examples/fapi2-message-signing.ts@@ -26,7 +26,7 @@ const code_verifier = oauth.generateRandomCodeVerifier() const code_challenge = await oauth.calculatePKCECodeChallenge(code_verifier) const code_challenge_method = 'S256' -let request_uri: string+let request: string { const params = new URLSearchParams() params.set('client_id', client.client_id)@@ -34,8 +34,18 @@ let request_uri: string params.set('code_challenge_method', code_challenge_method) params.set('redirect_uri', redirect_uri) params.set('response_type', 'code')+ params.set('response_mode', 'jwt') params.set('scope', 'openid email') + request = await oauth.issueRequestObject(as, client, params, clientPrivateKey)+}++let request_uri: string+{+ const params = new URLSearchParams()+ params.set('client_id', client.client_id)+ params.set('request', request)+ const response = await oauth.pushedAuthorizationRequest(as, client, params, { DPoP, clientPrivateKey,@@ -73,7 +83,7 @@ let request_uri: string { // @ts-expect-error const currentUrl: URL = getCurrentUrl()- const params = oauth.validateAuthResponse(as, client, currentUrl, oauth.expectNoState)+ const params = await oauth.validateJwtAuthResponse(as, client, currentUrl, oauth.expectNoState) if (oauth.isOAuth2Error(params)) { console.log('error', params) throw new Error() // Handle OAuth 2.0 redirect error
oauth4webapi

Version Info

Tagged at
2 years ago