-
Notifications
You must be signed in to change notification settings - Fork 273
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
feat: Support additional request parameters for 3LO #1070
base: main
Are you sure you want to change the base?
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
91bc925
to
5c24548
Compare
); | ||
} | ||
|
||
public AuthorizationCodeFlow( |
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.
lets remove this overloaded method. If someone really wants to pass additional parameters, they can create builder, set additionalparam and call build() on the builder. Exactly like what we have done in the test.
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.
Yes I see. I have removed overloaded method.
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.
Lets remove this overloaded method
@@ -156,6 +184,7 @@ protected AuthorizationCodeFlow(Builder builder) { | |||
clientId = Preconditions.checkNotNull(builder.clientId); | |||
authorizationServerEncodedUrl = | |||
Preconditions.checkNotNull(builder.authorizationServerEncodedUrl); | |||
additionalParameters = Preconditions.checkNotNull(builder.additionalParameters); |
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.
no need of null check here because it is an optional thing. You are checking for null before using it.
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.
Ah! Removed precondition check.
setClientAuthentication(clientAuthentication); | ||
setClientId(clientId); | ||
setAuthorizationServerEncodedUrl(authorizationServerEncodedUrl); | ||
setAdditionalParameters(Collections.<String, String>emptyMap()); |
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 is ok to just leave additional params as null. No need to set as empty map. It is ok to have it as well, no harm.
google-oauth-client/src/main/java/com/google/api/client/auth/oauth2/AuthorizationCodeFlow.java
Outdated
Show resolved
Hide resolved
...-client/src/test/java/com/google/api/client/auth/oauth2/AuthorizationCodeRequestUrlTest.java
Outdated
Show resolved
Hide resolved
Run |
Successfully ran command "mvn com.coveo:fmt-maven-plugin:format" on repo. Not sure how to clear up the missing CLA. |
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.
LGTM
This could happen if you contributed to this PR using different emails from different PCs. |
Introduce a way to pass additional parameters to auhtorization url
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.