# Chapter 22 Retrieve user info from Google

**URL:** <https://forums.kodeco.com/t/chapter-22-retrieve-user-info-from-google/178813>\
**Category:** Server Side Swift with Vapor\
**Created:** [September 23, 2022, 11:36am UTC](https://forums.kodeco.com/t/chapter-22-retrieve-user-info-from-google/178813 "2022-09-23T11:36:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anastasiiagolts](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/anastasiiagolts/32/102075_2.png) [@anastasiiagolts](https://forums.kodeco.com/u/anastasiiagolts)\
**Post date:** [September 23, 2022, 11:36am UTC](https://forums.kodeco.com/t/chapter-22-retrieve-user-info-from-google/178813/1 "2022-09-23T11:36:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![robertomachorro](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/robertomachorro/32/111603_2.png) [@robertomachorro](https://forums.kodeco.com/u/robertomachorro)\
**Post date:** [September 23, 2022, 2:19pm UTC](https://forums.kodeco.com/t/chapter-22-retrieve-user-info-from-google/178813/2 "2022-09-23T14:19:37Z")

</div>

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

```auto
openid email
openid profile
...

```

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

> **[OpenID Connect  |  Authentication  |  Google Developers](https://developers.google.com/identity/openid-connect/openid-connect)**

> **[OpenID Connect  |  Authentication  |  Google Developers](https://developers.google.com/identity/openid-connect/openid-connect)**
