Getting the gender,birthday,photo from google UserInfo

4.7k views Asked by At

I am trying to get the birthday,gender and photo information. I added two url into scope "userinfo.email" and "userinfo.profile" into scope.

when my program redirects to below link,

"https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=auto&client_id=329032112127.apps.googleusercontent.com&redirect_uri=http://userdetails1.appspot.com/UserServlet1&response_type=code&scope=https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile"

If user is not login in. It shows the login window. I do not want to do that. I want that , it gets automatically login or else just bypass the login page and give back me user information.

Now when i login then it is giving back me response. I do not want like that.

Is there any other way...? Please replay..?

1

There are 1 answers

1
Tim Bray On

I’m not sure I understand, but have a look at https://developers.google.com/accounts/docs/OAuth2Login - it seems like prompt=none will either silently succeed (if already approved) or silently fail. Is that what you want? But you can’t get the userinfo without a login/approval having happened.