-
-
Notifications
You must be signed in to change notification settings - Fork 393
/
jar.diff
25 lines (23 loc) · 837 Bytes
/
jar.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
diff --git a/examples/oauth.ts b/examples/jar.ts
index d87c63e..6219287 100644
--- a/examples/oauth.ts
+++ b/examples/jar.ts
@@ -6,6 +6,7 @@ let getCurrentUrl!: (...args: any) => URL
let server!: URL // Authorization server's Issuer Identifier URL
let clientId!: string
let clientSecret!: string
+let clientPrivateKey!: client.CryptoKey | client.PrivateKey
/**
* Value used in the authorization request as redirect_uri pre-registered at the
* Authorization Server.
@@ -51,7 +52,11 @@ let state!: string
parameters.state = state
}
- let redirectTo = client.buildAuthorizationUrl(config, parameters)
+ let redirectTo = await client.buildAuthorizationUrlWithJAR(
+ config,
+ parameters,
+ clientPrivateKey,
+ )
console.log('redirecting to', redirectTo.href)
// now redirect the user to redirectTo.href