-
Notifications
You must be signed in to change notification settings - Fork 214
Scopes not working for Google on Android #29
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
Comments
Apparently scopes are not working on Android at all. I tried with github and did not work as well. cc @auser |
Try including
|
@LaurelOlson I can try that, thanks, but would only partially fix the problem because the app has multiple github login buttons to support different scopes (public, private, ...) |
That config is dynamic, @brunolemos You can send any ole' config with any |
@auser this is what I'm currently doing and works fine on iOS, but not android:
Are you saying that there is a different format that would work on both iOS and Android? |
I searched this repository for "scopes" and I could find the parameter being used in the iOS native module but not on Android's. |
Yikes! Just pushed a fix for this. Thanks for the heads up! |
Hi @auser, still not working for GitHub... With the new update, I can pass the
|
are you getting a And when you pass |
manager.configure({
github: {
client_id: '...',
client_secret: '...',
redirect_uri: 'http://localhost/github',
scope: 'user **public_repo** notifications read:org',
scopes: 'user **public_repo** notifications read:org',
},
}); ps1: I'm using both
manager.authorize('github', {
scope: 'user **repo** notifications read:org',
scopes: 'user **repo** notifications read:org'
});
iOS response is fine. It has the
The android response is totally diferrent and doesn't have the |
@auser do you prefer that I open a new issue or could you just reopen this one? |
This should be relatively easy to update. Interested in contributing? The credentials for iOS (look fine, yes?) are in the |
@brunolemos can you try the latest version on master? |
@auser tested it, almost there. Now I'm receiving the Android response
iOS response
TestingFor you to test, you can:
Doing this, I currently have this on iOS: and this on android: {
"message": "Missing the 'notifications' scope.",
"documentation_url": "https://developer.github.com/v3"
} |
I'll try this when I get back to a keyboard. I'm inclined to remove the type all together, because that was really just for testing. The scopes are comma separated, not space separated. I'll check the iOS side after I fix the android side (although it was working on my tests...). Anyway, will report back what I find. |
+1 No scope returned on iOS for me. Should another issue be opened regarding iOS? |
I got scopes to work with Google OAuth by doing |
@jasongrishkoff can you remove "for Google" from the title please? |
TODO:
Can you think of anything else? Also, |
@auser the first todo is more like "make the android response and ios response exactly equal" 😝 The second todo is the really important here in this issue! Thanks. -- |
Can you try the latest version? I just posted a new version that should address the TODO 2 |
@auser thanks, it works! 🎉 |
Woohoo! |
I believe I pushed an npm update too. Away from the keyboard. |
Small difference on the responses: |
Maybe this could help, setting the credential's scopes into fully qualified URL separated by '+' will also work for you: google: {
...,
scopes: {
'https://www.googleapis.com/auth/plus.login+' +
'https://www.googleapis.com/auth/calendar+' +
'https://www.googleapis.com/auth/calendar.readonly+' +
'https://www.googleapis.com/auth/contacts+' +
'https://www.googleapis.com/auth/contacts.readonly+' +
'https://www.googleapis.com/auth/userinfo.profile+' +
'https://www.googleapis.com/auth/userinfo.email+' +
'https://www.googleapis.com/auth/user.addresses.read+' +
'https://www.googleapis.com/auth/user.birthday.read+' +
'https://www.googleapis.com/auth/user.emails.read+' +
'https://www.googleapis.com/auth/user.phonenumbers.read'
}
} But BTW i have another error that appears after the scopes' hand check, cf: #61 is anyone is receiving the same error, in XCode logs: |
Hi there,
I'm trying to pass scope to Google as follows:
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
The text was updated successfully, but these errors were encountered: