react-native-oauth: Scopes not working for Google on Android
Hi there,
I’m trying to pass scope to Google as follows:
manager.authorize('google', {scopes: 'profile email'})
.then(resp => this.cleanLoginData('google',resp.response))
.catch(err => console.log('There was an error'))
However, that doesn’t seem to provide the email when I try to call manager.makeRequest(‘google’,googleUrl) to https://www.googleapis.com/oauth2/v1/userinfo?alt=json.
The solution was to go into android/src/main/java/io/fullstack/oauth/OAuthManagerProviders.java and change line 101 to String scope = “profile email”;
Is this a known issue, or am I doing something wrong? I notice that a lot of the language in the java files refers to “scope” rather than “scopes” (with the “s”), as passed in the above authorize code snippet. Could this be the issue?
Thanks! Jason
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 26 (22 by maintainers)
Commits related to this issue
- Fixed scopes on Android (#29) and added Slack insructions to README (ios only) — committed to fullstackreact/react-native-oauth by auser 7 years ago
- Addresses #29 - Bring the iOS and Android response objects on authorized closer together — committed to fullstackreact/react-native-oauth by auser 7 years ago
Try including
scope
in the config constant along with theclient_id
andclient_secret
instead of in the options hash like so: