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

[1.15.x][ELY-2564] Add the ability to disable OIDC access token typ claim validation via a system property #1919

Merged
merged 13 commits into from Jun 14, 2023

Conversation

fjuma
Copy link
Contributor

@fjuma fjuma commented Jun 13, 2023

https://issues.redhat.com/browse/ELY-2564
https://issues.redhat.com/browse/JBEAP-24829

Depends on #1917

Note: I am still working on the tests for this one but this can start to be reviewed in the meantime.

fjuma and others added 12 commits June 8, 2023 10:51
Method isAutodetectedBearerOnly() should be invoked after checking cached token.

Invoking isAutodetectedBearerOnly() early will break every AJAX request that relies on HTTP session. A clear example is JSF Partial Request, it will never send the header "Authorization" neither the query parameter "auth". During the initial load of view the user was authenticated, then the token was stored in HTTP session, so, JSF Partial Request relies on HTTP session onwards.

https://issues.redhat.com/browse/ELY-2487
Signed-off-by: Patrick Reinhart <patrick@reini.net>
@@ -241,4 +245,33 @@ public String getError() {
}
}

public static AccessAndIDTokenResponse getBearerToken(OidcClientConfiguration oidcClientConfiguration, String username, String password) throws Exception {
AccessAndIDTokenResponse tokenResponse;
HttpClient client = oidcClientConfiguration.getClient();
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't checked object access in all the new methods but should we be having some Assert.checkNotNull calls for the mandatory parameters?

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 called from private API and will be called with valid parameters. In general though, it would probably be good to do a pass through these types of methods to add checkNotNull calls where appropriate. I'll add some good first issues for that I think.

@@ -0,0 +1,545 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2022 Red Hat, Inc., and individual contributors
Copy link
Contributor

Choose a reason for hiding this comment

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

2023?

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 file is part of the backported commits.

@fjuma fjuma force-pushed the ELY-2564-1.15.x branch 2 times, most recently from 8a930f7 to ac872f8 Compare June 14, 2023 15:53
@fjuma
Copy link
Contributor Author

fjuma commented Jun 14, 2023

I've now added tests to this PR.

@fjuma fjuma merged commit 28aa99a into wildfly-security:1.15.x Jun 14, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants