-
Notifications
You must be signed in to change notification settings - Fork 265
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
Provide option to skip idToken signature validation #131
Conversation
f84b16e
to
386a287
Compare
386a287
to
f1ad98d
Compare
f798546
to
825f307
Compare
lib/clientBuilder.js
Outdated
@@ -78,6 +78,10 @@ function OktaAuthBuilder(args) { | |||
this.options.maxClockSkew = args.maxClockSkew; | |||
} | |||
|
|||
// Give the developer the ability to disable token signature | |||
// validation. | |||
this.options.ignoreSignature = args.ignoreSignature === true ? true : false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified to !!args.ignoreSignature
a0bc65e
to
f3751dc
Compare
f3751dc
to
907641e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, LGTM otherwise
lib/oauthUtil.js
Outdated
if (!claims || !iss || !aud) { | ||
throw new AuthSdkError('The jwt, iss, and aud arguments are all required'); | ||
} | ||
|
||
if (nonce && claims.nonce !== nonce) { | ||
if (validationParams.nonce && claims.nonce !== validationParams.nonce) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going to destrcture aud
and iss
, let's do the same for nonce
lib/token.js
Outdated
@@ -48,12 +48,14 @@ function verifyToken(sdk, token, nonce, ignoreSignature) { | |||
|
|||
var jwt = decodeToken(token.idToken); | |||
|
|||
var validationOptions = oauthUtil.getDefaultValidationParams(sdk, validationParams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this broken out to a function for test purposes? I ask because it feels like it would be more clear to just have the defaults as a literal, and then extend it with the incoming options. Having "get" functions that mutate their arguments never feel great.
@@ -78,6 +78,10 @@ function OktaAuthBuilder(args) { | |||
this.options.maxClockSkew = args.maxClockSkew; | |||
} | |||
|
|||
// Give the developer the ability to disable token signature | |||
// validation. | |||
this.options.ignoreSignature = !!args.ignoreSignature; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offline conversation: add this to README
13ffd77
to
cc4ef89
Compare
Description
Grants developers the ability to disable
idToken
signature validation for testing purposes and browser support.Usage
The
ignoreSignature
param can be passed in during either client configuration or token validation.Client configuration
Token validation
Resolves