This repository has been archived by the owner on Jun 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
More Okta updates to TCK #330
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ea32b59
Minor fixes
nbarbettini 8b33bef
Increase timeout because Okta doesn't send immediately
nbarbettini 633accc
Use RSA signing instead of symmetric
nbarbettini 22afa77
Fix change tests for Okta
nbarbettini 97c8615
Okta refresh token is not a JWT
nbarbettini 32e2bc7
Verify email instead of href
nbarbettini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,7 +128,7 @@ class Oauth2IT extends AbstractIT { | |
.extract() | ||
.path("access_token") | ||
|
||
assertTrue(JwtUtils.extractJwtClaim(accessToken, "sub") == account.href) | ||
assertTrue(JwtUtils.extractJwtClaim(accessToken, "sub") == account.email) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably be an |
||
} | ||
|
||
/** Password grant flow with username/password and access_token cookie present | ||
|
@@ -156,7 +156,7 @@ class Oauth2IT extends AbstractIT { | |
.extract() | ||
.path("access_token") | ||
// @formatter:on | ||
assertTrue(JwtUtils.extractJwtClaim(accessToken, "sub") == account.href) | ||
assertTrue(JwtUtils.extractJwtClaim(accessToken, "sub") == account.email) | ||
} | ||
|
||
/** Password grant flow with email/password | ||
|
@@ -178,7 +178,7 @@ class Oauth2IT extends AbstractIT { | |
.extract() | ||
.path("access_token") | ||
|
||
assertTrue(JwtUtils.extractJwtClaim(accessToken, "sub") == account.href) | ||
assertTrue(JwtUtils.extractJwtClaim(accessToken, "sub") == account.email) | ||
} | ||
|
||
/** Refresh grant flow | ||
|
@@ -215,7 +215,7 @@ class Oauth2IT extends AbstractIT { | |
.path("access_token") | ||
|
||
assertNotEquals(accessToken, newAccessToken, "The new access token should not equal to the old access token") | ||
assertTrue(JwtUtils.extractJwtClaim(accessToken, "sub") == account.href, "The access token should be a valid jwt for the test user") | ||
assertTrue(JwtUtils.extractJwtClaim(accessToken, "sub") == account.email, "The access token should be a valid jwt for the test user") | ||
} | ||
|
||
/** Refresh grant flow should fail without valid refresh token | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,16 +22,19 @@ class EnvUtils { | |
|
||
public static final String stormpathHtmlEnabled = getVal("STORMPATH_TCK_HTML_ENABLED", "true") | ||
|
||
public static final String jwtSigningKey | ||
public static final String facebookClientId | ||
public static final String facebookClientSecret | ||
|
||
public static final String jwtSigningKeyModulus | ||
public static final String jwtSigningKeyExponent | ||
|
||
static { | ||
jwtSigningKey = getVal("JWT_SIGNING_KEY") | ||
jwtSigningKeyModulus = getVal("JWT_SIGNING_KEY_MOD") | ||
jwtSigningKeyExponent = getVal("JWT_SIGNING_KEY_EXP") | ||
facebookClientId = getVal("FACEBOOK_CLIENT_ID") | ||
facebookClientSecret = getVal("FACEBOOK_CLIENT_SECRET") | ||
if (jwtSigningKey == null || facebookClientId == null || facebookClientSecret == null) { | ||
fail("JWT_SIGNING_KEY, FACEBOOK_CLIENT_ID and FACEBOOK_CLIENT_SECRET environment variables are required") | ||
if (jwtSigningKeyModulus == null || jwtSigningKeyExponent == null || facebookClientId == null || facebookClientSecret == null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should probably allow setting both. Or we could just set the |
||
fail("JWT_SIGNING_KEY_MOD, JWT_SIGNING_KEY_EXP, FACEBOOK_CLIENT_ID and FACEBOOK_CLIENT_SECRET environment variables are required. The JWT signing key modulus (n) and exponent (e) can be found at https://<your-org>.oktapreview.com/oauth2/<authServerId>/v1/keys") | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 cannot be hard coded, the tests work against both stormpath and okta (and if sending verification emails through a non-okta domain the from from may be different) i.e. google forces the 'from' field to the sender.
(I hacked up a fix for this yesterday before seeing your PR