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 return token #40

Closed
MosheWorld opened this issue Dec 23, 2017 · 5 comments
Closed

Google does not return token #40

MosheWorld opened this issue Dec 23, 2017 · 5 comments

Comments

@MosheWorld
Copy link

Hey there, I am trying to get token from google and it seems I receive all the data and not the important one, any suggestions?

This is what I get from them.

email:"mmoshikooclassifiedgmail.com",
id:"claasified",
name:"Moshe",
photoUrl:"https://lh4.googleusercontent.com/dC7huzWQ1Sc/AAAAAAAAAAI/.../s96-c/photo.jpg",
provider:"GOOGLE"

Thanks for help!

@jinryung1983
Copy link

I've seen issue code in google-login-provider.ts file.
let token = this.auth2.currentUser.get().getAuthResponse(true).access_token;

this code should be as following
let token = this.auth2.currentUser.get().getAuthResponse().id_token;

it may typo. :)

@kangw3n
Copy link
Collaborator

kangw3n commented Dec 26, 2017

i think access_token is correct in this situation?

token which pass back to user should be access_token for oAuth authentication?

https://stackoverflow.com/questions/46681889/clarification-on-id-token-vs-access-token

@kangw3n
Copy link
Collaborator

kangw3n commented Dec 26, 2017

for @MosheWorld

i think npm for this project hasn't been update yet.
@jaibatrik might need republish to npm for your issues to work.

or u can manually changing your local angular4-social-login.umd.js by adding the following code inside
GoogleLoginProvider prototype fn

var token = _this.auth2.currentUser.get().getAuthResponse(true).access_token;

and return it back as user.authToken property

@jaibatrik
Copy link
Contributor

@MosheWorld @kangw3n I have pushed it to the npm. Thanks!

@jaibatrik
Copy link
Contributor

@MosheWorld You may need to do npm install angular4-social-login@latest to get the changes.

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

4 participants