-
Notifications
You must be signed in to change notification settings - Fork 147
Remove usage of com.nimbusds.oauth2's HTTP classes #927
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
Conversation
@@ -29,7 +27,6 @@ public abstract class AbstractClientApplicationBase extends AbstractApplicationB | |||
private String applicationName; | |||
private String applicationVersion; | |||
private AadInstanceDiscoveryResponse aadAadInstanceDiscoveryResponse; | |||
protected abstract ClientAuthentication 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.
We don't need a replacement for this?
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.
Long story short, this was mainly used as a parameter or return type of various nimbus methods. It's utility behavior was fully delegated to other classes:
- It represented a client assertion/secret/cert, which some existing MSAL classes did as well
- It was used to add query parameters to an HTTP request, but
TokenRequestExecutor.addJWTBearerAssertionParams()
now handles that - It was passed into some nimbus APIs that are no longer used
|
||
final String location = HttpUtils.headerValue(httpResponse.headers(), "Location"); | ||
if (!StringHelper.isBlank(location)) { | ||
try { | ||
response.setLocation(new URI(location)); | ||
response.addHeader("Location", new URI(location).toString()); |
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 worth it to have an enum/constants for well known headers.
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 was planning to do this in a follow up PR that removes various nimbus utility methods, since we'll then have the full picture of what constants and enums would be useful
Remove usage of com.nimbusds.oauth2's Token classes
This PR removes usage of several com.nimbusds.oauth2 classes, as per #909
Mainly HTTPRequest, HTTPResponse, and ClientAuthentication were removed, along with some related minor utils. These were essentially just used as a helper for making HTTP requests: managing query parameters, creating assertions for different credentials, etc.
To replace them, this PR does the following:
ConfidentialClientApplication
related to credentials and assertions, it now mainly deals with assertion/secret Strings, some logic was moved to other classes, and some methods that now had duplicate or unused codeTokenRequestExecutor
related to credentials and assertions, simplifying and clarifying the behavior around query parameters and assertions/secrets that are needed in each scenario