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 access_token support to getWithoutPrompt #28

Merged
merged 4 commits into from
Jul 20, 2016

Conversation

lboyette-okta
Copy link
Contributor

@lboyette-okta lboyette-okta commented Jul 14, 2016

Resolves: OKTA-95512

The point is to add access_token support to the sdk, so let's do that!

@rchild-okta
@stsai-okta

@lboyette-okta lboyette-okta force-pushed the lb-95512-getWithoutPrompt-accessToken branch 3 times, most recently from 4af5f66 to a6cfd9a Compare July 14, 2016 20:55
@@ -58,5 +58,96 @@ define(function(require) {
done();
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update this test with an expected response?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is using the default expectedResp defined in oauthUtil.

@lboyette-okta lboyette-okta force-pushed the lb-95512-getWithoutPrompt-accessToken branch from 9db0429 to b9abe34 Compare July 19, 2016 00:03
@@ -343,6 +343,10 @@ function getIdToken(sdk, oauthOptions, options) {
throw new AuthSdkError('A clientId must be specified in the OktaAuth constructor to get an idToken');
}

if (util.isString(oauthParams.responseType) && oauthParams.responseType.indexOf(' ') !== -1) {

Choose a reason for hiding this comment

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

oauthParams.responseType.indexOf(' ') Is checking just space good enough?

Copy link
Contributor Author

@lboyette-okta lboyette-okta Jul 20, 2016

Choose a reason for hiding this comment

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

It should be. The way the authorize endpoint works, it accepts a response_type that's space separated ie. id_token token. We don't want devs to pass in these response types as a string and space-separation seems like the most common slipup.

Also, space-separation is the only scenario where the api works, but the sdk doesn't (it'd simply return the first token in the list). If a user passed a comma, semicolon, or anything else, the api would throw an error about an incorrect response_type and the sdk would pass that error to the dev.

@rchild-okta
Copy link
Contributor

Overall looks good - couple minor comments and then 🚢

@lboyette-okta lboyette-okta force-pushed the lb-95512-getWithoutPrompt-accessToken branch from 54ec2e4 to d6e2a77 Compare July 20, 2016 21:13
@lboyette-okta lboyette-okta force-pushed the lb-95512-getWithoutPrompt-accessToken branch from d6e2a77 to 1bd505b Compare July 20, 2016 21:14
@lboyette-okta lboyette-okta merged commit 96c5251 into master Jul 20, 2016
@jmelberg-okta jmelberg-okta deleted the lb-95512-getWithoutPrompt-accessToken branch April 23, 2018 16:52
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