-
Notifications
You must be signed in to change notification settings - Fork 75
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
New oauth2 [Do not merge] #854
Open
hsinn0
wants to merge
18
commits into
main
Choose a base branch
from
new-oauth2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
- Made the `oauth2ResourceServer` code block compilable. - Added a couple of new oauth2-specific spring-security dependencies that are reuired in runtime in `:components:auth` sub-project. They are likely to be neeeded in other sub-projects, too. - In `AuthConfigurationTest`, `infoCanBeAccessedWithoutAuthentication()` and `healthCanBeAccessWithoutAuthentication()` pass. Other cases that have something to do with actual auth either fail or took too long for me to able to see the result. Co-authored-by: Joe Eltgroth <[email protected]>
- Rewrote the class in Java, replacing the use of the old oauth2 lib with new lib. - Made all test cases except 4 mTLS-related ones pass in `AuthConfigurationTest`. - Have not tried to run the production code, i.e. run the credhub server application yet. Co-authored-by: Joe Eltgroth <[email protected]>
- Made temporary changes in `UserContextFactoryTest.kt` to avoid compile errors. - Reordered imports in `AuthConfiguration.java` to satisfy `checkstyle`. - Resolved ktlint errors in `UserContextFactory.kt` and `UserContextFactoryTest.kt`.
- Corrected wrong filter orders. Co-authored-by: Joe Eltgroth <[email protected]>
… of literal. Co-authored-by: Joe Eltgroth <[email protected]>
- It was failing if `security.oauth2.resource.jwt.key_value' property was not set. We need that propperty for unit-test and backward compatibility. - Modified `jwtDecoder` bean to honor 'jwt.key_value' property if it exists. Otherwise, use the JWK Set URI. - With this change, credhub server app starts without any noticeable issues. Basic credhub-cli commands such as `login` and `find` also work. - Needs more testing against different ednpoints of the running credhub server. Co-authored-by: Joe Eltgroth <[email protected]>
- Modified the method signature to declare specific Exceptions instead of the base checked exception class.
- Had a space at the beginning of the vaiue. - Was not an issue with old oauth2 lib. - But `spring-security-oauth2-resource-server` considers it as malformed.
unauthenticated (401) with detailed information about the token'd deficiency. This seems consistent with the new Spring Security api. Also the published REST api does not specify error responses. We may need to rethink this, however, if end-to-end testing shows other systems are relying on the detailed response.
- Spying `oAuth2IssuerService!!.getIssuer()` does not work with modified `AuthConfiguration` as `jwtDecoder` bean is created at the startup. - Instead, to manipulate the issuerURI, just replace `jwtDecoder`'s `JwtValidator` to a desired one. - Also changed `AuthConfiguration.jwtDecoder()` to return `NimbusJwtDecoder` so we don't have to downcast it in the test code.
* Replaced Kotlin AuthWithoutOAuthConfiguration with Java * New Java class uses Spring Security 5 features and eliminates obsolete Spring Security OAuth
- Remove custom classes no longer necessary after new Spring Security configurations
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR from new-oauth2 feature branch. Not to be merged until the feature completes later. Creating the PR now so as to keep the state of build/test and difference from main in check.