-
Notifications
You must be signed in to change notification settings - Fork 154
Remove usage of com.nimbusds.oauth2 from grant-related classes #926
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
29add9f
Remove usage of com.nimbusds.oauth2 from grant-related classes
Avery-Dunn a660a03
Refactor and address PR feedback
Avery-Dunn aa16f7d
Merge branch 'dev' of https://github.com/AzureAD/microsoft-authentica…
Avery-Dunn 579e4d1
Resolve merge conflicts
Avery-Dunn 5440a80
Merge branch 'dev' of https://github.com/AzureAD/microsoft-authentica…
Avery-Dunn dc13c46
Address PR feedback
Avery-Dunn 0e775fc
Use Base64URL encoding and add test
Avery-Dunn 7580409
Merge branch 'avdunn/nimbus-removal' of https://github.com/AzureAD/mi…
Avery-Dunn 400e04e
Merge pull request #938 from AzureAD/avdunn/bas64-fix
Avery-Dunn df0298f
Update version and changelog for release 1.20.1
Avery-Dunn 56e6e65
Actually update changelog
Avery-Dunn 88e4f85
Merge pull request #939 from AzureAD/avdunn/release-1.20.1
Avery-Dunn fb6ae92
address codeql warnings
Ugonnaak1 5498402
address codeql warnings
Ugonnaak1 54f3d44
Merge pull request #940 from AzureAD/akaliugonna/codeqlIssues
Avery-Dunn 1643890
PR feedback, and correctly adjust parameters in ADFS username/passwor…
Avery-Dunn 4009b7a
Merge branch 'dev' of https://github.com/AzureAD/microsoft-authentica…
Avery-Dunn 8be97d5
Merge latest dev
Avery-Dunn cac03fc
Fix comment
Avery-Dunn 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| Export-Package: com.microsoft.aad.msal4j;version="1.20.0" | ||
| Export-Package: com.microsoft.aad.msal4j;version="1.20.1" | ||
| Automatic-Module-Name: com.microsoft.aad.msal4j |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,10 +3,10 @@ | |
|
|
||
| package com.microsoft.aad.msal4j; | ||
|
|
||
| import com.nimbusds.oauth2.sdk.AuthorizationCode; | ||
| import com.nimbusds.oauth2.sdk.AuthorizationCodeGrant; | ||
| import com.nimbusds.oauth2.sdk.AuthorizationGrant; | ||
| import com.nimbusds.oauth2.sdk.pkce.CodeVerifier; | ||
| import java.util.Collections; | ||
| import java.util.LinkedHashMap; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
| class AuthorizationCodeRequest extends MsalRequest { | ||
|
|
||
|
|
@@ -17,19 +17,19 @@ class AuthorizationCodeRequest extends MsalRequest { | |
| } | ||
|
|
||
| private static AbstractMsalAuthorizationGrant createMsalGrant(AuthorizationCodeParameters parameters) { | ||
| Map<String, List<String>> params = new LinkedHashMap<>(); | ||
|
|
||
| params.put(GrantConstants.GRANT_TYPE_PARAMETER, Collections.singletonList(GrantConstants.AUTHORIZATION_CODE)); | ||
| params.put("code", Collections.singletonList(parameters.authorizationCode())); | ||
|
|
||
| if (parameters.redirectUri() != null) { | ||
| params.put("redirect_uri", Collections.singletonList(parameters.redirectUri().toString())); | ||
| } | ||
|
|
||
| AuthorizationGrant authorizationGrant; | ||
| if (parameters.codeVerifier() != null) { | ||
| authorizationGrant = new AuthorizationCodeGrant( | ||
| new AuthorizationCode(parameters.authorizationCode()), | ||
| parameters.redirectUri(), | ||
| new CodeVerifier(parameters.codeVerifier())); | ||
|
|
||
| } else { | ||
| authorizationGrant = new AuthorizationCodeGrant( | ||
| new AuthorizationCode(parameters.authorizationCode()), parameters.redirectUri()); | ||
| params.put("code_verifier", Collections.singletonList(parameters.codeVerifier())); | ||
|
Member
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. I am not sure how much of PKCE was handled by nimbus, so please make sure we have enough tests that validate that auth_code uses PKCE. Both desktop and web app scenarios. |
||
| } | ||
|
|
||
| return new OAuthAuthorizationGrant(authorizationGrant, parameters.scopes(), parameters.claims()); | ||
| return new OAuthAuthorizationGrant(params, parameters.scopes(), parameters.claims()); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.