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

google does not honor the token i am getting from module and i am getting Error 401 : Unauthorized Invalid credentials. #14

Open
boazlautman opened this issue Sep 12, 2017 · 5 comments

Comments

@boazlautman
Copy link

boazlautman commented Sep 12, 2017

Using Ti.GoogleSignIn module by Hansemann, i am trying to access my google drive. Problem is that the google does not honor the token i am getting from module and i am getting Error 401 : Unauthorized Invalid credentials.

On the other hand, if i use the token from Google developer playground, it works as expected.

I am setting the scope in the following way

Google.initialize({

clientID : "***********************************************.apps.googleusercontent.com",

scope : ['https://www.googleapis.com/auth/plus.login', 'https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/drive.appdata', 'https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/drive.metadata'] // Scope

});

Could it be that the scope is not implemented for the android version
I opened the GooglesigninModule.java and didnt see any requestscopt
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestScopes(Scopes.DRIVE_APPFOLDER) //missing?!
.build()

Please help me with this issue!!
I'm struggling with this issue for days

Thanks in advanced!

@SamBellerose
Copy link

SamBellerose commented Oct 3, 2017

I think I'm getting the same error has you. I have a website using Google Sign in and the token received vs the one I receive with this module doesn't even look the same at all. The size of the token received with this module is extremely long vs the one I receive on my website. Have you found a solution to this ?

@electronic321
Copy link

@SamBellerose nopes, i could not find anything about this yet and yes you are right... the token length is unexpectedly too long as compared to playground ... Do you have any solution for google sign in ?

@chmiiller
Copy link
Collaborator

Guys did you solve your problems with this? I had once a user with a very long token and we had to update the type of token on server when writing to the database. But besides that, it has always worked. Let me know if you still having this otherwise I'm going to close this issue 👮

@lakshparmar13
Copy link

Does anyone have a workaround for this?
After login I tried to call https://www.googleapis.com/oauth2/v2/userinfo API but it says 401 Invalid Credentials

I noticed one thing with the module, that it does not prompt to user as "App wants to access your Google Account" "Allow" button. This seems to be issue.

@hansemannn
Copy link
Contributor

This is not a module issue. Please properly configure your credentials and use the web client id.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants