Chapter 22 Retrieve user info from Google

Hello everybody, I’ve got a question about retrieving user data to my app.
In the original app we don’t get any information about the logged in user, we just approve the request and then we can get their id by selecting them from the table.
I would like to get their id right after authorization. For example, to have a welcoming alert “Hello, (username)”
I’ve been trying for three days already, but still can’t figure it out. Maybe someone knows how to handle this situation? I’d be extremely grateful

During the OAuth2 authentication, you can change the scope to be openid, and it will allow you to get a users’ information. Examples:

openid email
openid profile
...

Since this is private information, your web application will have to be approved by Google.

1 Like