Get user info from access token Google
i'm testing getting user information by google access token http://www.mawk3y.net/glogin after clicking sign in button i get redirected to https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=access_token_here And get some JSON data like this
{ "issued_to": "my client id.apps.googleusercontent.com", "audience": "my client id.apps.googleusercontent.com", "user_id": "user id here", "scope": "https://www.googleapis.com/auth/plus.login", "expires_in": 3596, "access_type": "online" }
Access token
Try this one
var url = 'https://www.googleapis.com/plus/v1/people/me?access_token={access_token}'; $.ajax({ type: 'GET', url: url, async: false, success: function(userInfo) { //info about user console.log(userInfo); console.log('test'); }, error: function(e) { console.log('error'); } });
Có thể bạn đã miss một số snippets code