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

Call to setScopes(String...) with null field in AuthorizationCodeFlow results in NullPointerException #73

Closed
wonderfly opened this issue Jan 9, 2015 · 5 comments
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@wonderfly
Copy link
Contributor

From ranas...@umich.edu on February 28, 2013 13:24:29

Version of google-oauth-java-client (e.g. 1.5.0-beta)? 1.13.1-beta Java environment (e.g. Java 6, Android 2.3, App Engine)? Java 6 Describe the problem. Bug, setScopes(String...) being called with "null" parameter, being recognized by compiler as (Object)null. Called method expects null to be (Object[])null, and results in NullPointerException.

Caller:
com.google.api.client.auth.oauth2.AuthorizationCodeFlow.newAuthorizationUrl(AuthorizationCodeFlow.java:191)
Called:
com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl.setScopes(AuthorizationCodeRequestUrl.java:80) How would you expect it to be fixed? Cast field (this.scopes) to (String[]) when the field is null.

Original issue: http://code.google.com/p/google-oauth-java-client/issues/detail?id=73

@wonderfly wonderfly added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. imported priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Jan 9, 2015
@wonderfly
Copy link
Contributor Author

From raymond....@gmail.com on February 28, 2013 13:32:14

Something odd in that code. The caller uses single String expecting space-separated list of scopes, while the method being called expects varargs.

@wonderfly wonderfly self-assigned this Jan 9, 2015
@wonderfly
Copy link
Contributor Author

From yan...@google.com on April 19, 2013 18:51:23

Status: Accepted
Owner: yan...@google.com
Cc: pele...@google.com ngmic...@google.com
Labels: Milestone-Version1.15.0 Component-OAuth2

@wonderfly
Copy link
Contributor Author

From yan...@google.com on April 20, 2013 06:03:38

Owner: pele...@google.com
Cc: -pele...@google.com yan...@google.com

@wonderfly
Copy link
Contributor Author

From pele...@google.com on April 23, 2013 15:00:24

https://codereview.appspot.com/8865045/ https://codereview.appspot.com/8632052/

Status: Started

@wonderfly
Copy link
Contributor Author

From pele...@google.com on May 02, 2013 07:36:23

I added a new setScopes(Collection) method and deprecated (and beta) setScopes(String...) and setScopes(Iterable).

same was done to setResponseTypes.

I also changed setRefreshListeners from getting a List to get a Collection.

Status: Fixed

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. 🚨 This issue needs some love. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants