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

Add support for "grantType" as alias for PKCE #235

Merged
merged 2 commits into from
Aug 8, 2019

Conversation

aarongranick-okta
Copy link
Contributor

@aarongranick-okta aarongranick-okta commented Aug 7, 2019

Copy link
Contributor

@robertjd robertjd left a comment

Choose a reason for hiding this comment

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

Approving, please built this and test the widget with the build before merging and publishing

@aarongranick-okta
Copy link
Contributor Author

Screen Shot 2019-08-08 at 10 30 14 AM

Screen Shot 2019-08-08 at 10 41 18 AM

before and after `yalc add @okta/okta-auth-js` from local working copy

@aarongranick-okta aarongranick-okta merged commit 2ae6f02 into master Aug 8, 2019
@aarongranick-okta aarongranick-okta deleted the ag-grantType branch August 8, 2019 17:43
@@ -31,14 +31,16 @@ function OktaAuthBuilder(args) {
var sdk = this;

var url = builderUtil.getValidUrl(args);
// OKTA-242989: support for grantType will be removed in 3.0
var usePKCE = args.pkce || args.grantType === 'authorization_code';

Choose a reason for hiding this comment

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

This change overrides my configuration when I have pkce: false and grantType: 'authorization_code'.

Do you 'have' to use pkce with an auth_code grant?

There are a few places in the code that do this type of boolean coalesce operation that override an explicit parameter that is already set to false

Copy link
Contributor Author

@aarongranick-okta aarongranick-okta Aug 23, 2019

Choose a reason for hiding this comment

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

The grantType parameter was added specifically for PKCE, it has no other function. We have deprecated it because of the confusion it has caused with non-PKCE ("standard") authorization_code flow. To perform "standard" authorization_code flow, you should set the responseType to ['code']. Do not use the grantType option, it is only an alias for pkce and we will remove it in the near future.

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.

3 participants