diff --git a/examples/oauth.ts b/examples/private_key_jwt.ts index cc6d632..7bf6b06 100644 --- a/examples/oauth.ts +++ b/examples/private_key_jwt.ts @@ -8,12 +8,16 @@ let algorithm!: | 'oidc' /* For .well-known/openid-configuration discovery */ | undefined /* Defaults to 'oidc' */ let client_id!: string -let client_secret!: string /** * Value used in the authorization request as redirect_uri pre-registered at the Authorization * Server. */ let redirect_uri!: string +/** + * A key that the client has pre-registered at the Authorization Server for use with Private Key JWT + * client authentication method. + */ +let clientPrivateKey!: CryptoKey // End of prerequisites @@ -23,8 +27,7 @@ const as = await oauth const client: oauth.Client = { client_id, - client_secret, - token_endpoint_auth_method: 'client_secret_basic', + token_endpoint_auth_method: 'private_key_jwt', } const code_challenge_method = 'S256' @@ -77,6 +80,7 @@ let access_token: string params, redirect_uri, code_verifier, + { clientPrivateKey }, ) let challenges: oauth.WWWAuthenticateChallenge[] | undefined