-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Oidc additional client auth types #58708
Merged
ywangd
merged 10 commits into
elastic:master
from
jkakavas:oidc-additional-client-auth-types
Sep 14, 2020
Merged
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3360fa1
wip
jkakavas 7050759
OIDC: Enable additional client auth types
jkakavas 45d9a74
Merge remote-tracking branch 'origin/master' into oidc-additional-cli…
jkakavas 0467b14
remove random characters from config
jkakavas e1e5537
address feedback
jkakavas e66c6e5
Merge remote-tracking branch 'origin/master' into oidc-additional-cli…
jkakavas 49cd438
address feedback
jkakavas 0636079
Merge branch 'master' into oidc-additional-client-auth-types
elasticmachine 52a4c80
Merge remote-tracking branch 'origin/master' into oidc-additional-cli…
ywangd 1dcd6f3
Apply Rene's fix for test fixture
ywangd 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
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 |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
import com.nimbusds.jwt.proc.BadJWTException; | ||
import com.nimbusds.oauth2.sdk.ResponseType; | ||
import com.nimbusds.oauth2.sdk.Scope; | ||
import com.nimbusds.oauth2.sdk.auth.ClientAuthenticationMethod; | ||
import com.nimbusds.oauth2.sdk.auth.Secret; | ||
import com.nimbusds.oauth2.sdk.id.ClientID; | ||
import com.nimbusds.oauth2.sdk.id.Issuer; | ||
|
@@ -841,8 +842,11 @@ private RelyingPartyConfiguration getDefaultRpConfig() throws URISyntaxException | |
new ResponseType("id_token", "token"), | ||
new Scope("openid"), | ||
JWSAlgorithm.RS384, | ||
ClientAuthenticationMethod.CLIENT_SECRET_BASIC, | ||
JWSAlgorithm.HS384, | ||
new URI("https://rp.elastic.co/successfull_logout")); | ||
} | ||
|
||
private RelyingPartyConfiguration getRpConfig(String alg) throws URISyntaxException { | ||
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. Nit: need a blank line before this method. |
||
return new RelyingPartyConfiguration( | ||
new ClientID("rp-my"), | ||
|
@@ -851,6 +855,8 @@ private RelyingPartyConfiguration getRpConfig(String alg) throws URISyntaxExcept | |
new ResponseType("id_token", "token"), | ||
new Scope("openid"), | ||
JWSAlgorithm.parse(alg), | ||
ClientAuthenticationMethod.CLIENT_SECRET_BASIC, | ||
JWSAlgorithm.HS384, | ||
new URI("https://rp.elastic.co/successfull_logout")); | ||
} | ||
|
||
|
@@ -862,6 +868,8 @@ private RelyingPartyConfiguration getRpConfigNoAccessToken(String alg) throws UR | |
new ResponseType("id_token"), | ||
new Scope("openid"), | ||
JWSAlgorithm.parse(alg), | ||
ClientAuthenticationMethod.CLIENT_SECRET_BASIC, | ||
JWSAlgorithm.HS384, | ||
new URI("https://rp.elastic.co/successfull_logout")); | ||
} | ||
|
||
|
Oops, something went wrong.
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.
Maybe I am missing something obvious. But
client_id
is not added as one of the request parameters? The map returned fromClientSecretJWT.toParameters()
only containsclient_assertion
andclient_assertion_type
if I read the code correctly.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.
It's not, it doesn't need to be. It is added as the
iss
claim of the JWT and validated from there.yes, these are the two parameters needed, see https://openid.net/specs/openid-connect-core-1_0.html#ClientAuthentication
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.
You are right. For a moment, I forgot how JWT is organized. It's too late for me ...
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.
I know that feeling !!! :) No need to go through this today, it can definitely wait. I raised the PR because I had it ready since last week