Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: responseType=code: return code, support pkce=false #355

Merged
merged 2 commits into from
Mar 27, 2020

Conversation

aarongranick-okta
Copy link
Contributor

This is a fix for non-SPA applications, using authorization_code flow. Generally these apps will process the code server-side and so will not need to call parseFromUrl, but if they do they will receive an error. This fixes the logic so the code will not be exchanged for a token if pkce=false. The code will be returned.

@@ -229,16 +229,18 @@ function handleOAuthResponse(sdk, oauthParams, res, urls) {

var scopes = util.clone(oauthParams.scopes);
var clientId = oauthParams.clientId || sdk.options.clientId;
var pkce = sdk.options.pkce !== false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: isPkce or hasPkce or usesPkce?

@aarongranick-okta aarongranick-okta merged commit 047cb0a into master Mar 27, 2020
@aarongranick-okta aarongranick-okta deleted the ag-auth-code-fix-OKTA-283816 branch March 27, 2020 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants