Reputation: 657
Within the Dialog Flow console we can request that our Default Welcome Intent requires sign in from the user. We have this enabled.
After the user is signed in and the account is linked, we want to get the user's google id so that it can be exchanged for a token from our auth service allowing the user can make calls to our backend using the action.
I'm uncertain how to get the user's google id. I can see the user's profile in the conv
object. There is an idToken (jwt) that when it is decoded it looks like this
{
"sub": 1234567890, // The unique ID of the user's Google Account
"iss": "https://accounts.google.com", // The token's issuer
"aud": "123-abc.apps.googleusercontent.com", // Client ID assigned to your Actions project
"iat": 233366400, // Unix timestamp of the token's creation time
"exp": 233370000, // Unix timestamp of the token's expiration time
"name": "Jan Jansen",
"given_name": "Jan",
"family_name": "Jansen",
"email": "[email protected]", // If present, the user's email address
"locale": "en_US"
}
Upvotes: 0
Views: 165