From ead9c23d9e2e59cadbe379c484556b1c47c04a3e Mon Sep 17 00:00:00 2001 From: Hugh O'Brien Date: Sat, 7 Aug 2021 05:48:44 +0100 Subject: [PATCH 1/2] fix: oauth token exchange param naming convention https://developer.okta.com/docs/guides/implement-auth-code-pkce/exchange-code-token/ --- helpers/oauth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/oauth.js b/helpers/oauth.js index 4fc997330..15bd0ae55 100644 --- a/helpers/oauth.js +++ b/helpers/oauth.js @@ -220,7 +220,7 @@ const oauthRedirect = () => { code: q.code, client_id: getLocalConfig("client_id"), redirect_uri: redirectUri, - codeVerifier: getLocalConfig("pkce_codeVerifier"), + code_verifier: getLocalConfig("pkce_codeVerifier"), }) } catch (err) { console.log(`${error.error}\n\n${error.error_description}`) From 967ad773ebb8e6d6494c372774bc40408faa8414 Mon Sep 17 00:00:00 2001 From: Hugh O'Brien Date: Sat, 7 Aug 2021 06:29:49 +0100 Subject: [PATCH 2/2] Update oauth.js --- helpers/oauth.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/oauth.js b/helpers/oauth.js index 15bd0ae55..8e67ce202 100644 --- a/helpers/oauth.js +++ b/helpers/oauth.js @@ -154,10 +154,10 @@ const tokenRequest = async ({ }) => { // Check oauth configuration if (oidcDiscoveryUrl !== "") { - const { authorizationEndpoint, tokenEndpoint } = + const { authorization_endpoint, token_endpoint } = await getTokenConfiguration(oidcDiscoveryUrl) - authUrl = authorizationEndpoint - accessTokenUrl = tokenEndpoint + authUrl = authorization_endpoint + accessTokenUrl = token_endpoint } // Store oauth information