Unable to get profile information such as Name and Picture in the idToken payload from Google Provider #4512
Replies: 1 comment 3 replies
-
NextAuth.js does not do anything to the content of the Some providers like IS4 for example let you configure this, I'm not sure about Google, and I couldn't link to their documentation that would help either, unfortunately. That said, we decode the token and all information should be available in FWIW, here is my decoded {
iss: 'https://accounts.google.com',
azp: '***.apps.googleusercontent.com',
aud: '***.apps.googleusercontent.com',
sub: '111788689787958170610',
email: '***',
email_verified: true,
at_hash: 'aeZ8Ct_QsOBpI8vv5-PdNg',
name: 'NextAuth Test',
picture: 'https://lh3.googleusercontent.com/a-/AOh14GjRfRKa3CYlPLZz1JcM0WLj20jkAK83ssPOsszE=s96-c',
given_name: 'NextAuth',
family_name: 'Test',
locale: 'en-GB',
iat: 1651827405,
exp: 1651831005
} Config is here: next-auth/apps/dev/pages/api/auth/[...nextauth].ts Lines 109 to 112 in 8b6d2e3 |
Beta Was this translation helpful? Give feedback.
-
Provider type
Google
Environment
System:
OS: macOS 12.4
CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
Memory: 2.17 GB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 16.13.1 - /usr/local/bin/node
npm: 6.14.14 - ~/Documents/GitHub/yuser-network-web/node_modules/.bin/npm
Browsers:
Chrome: 101.0.4951.54
Safari: 15.5
npmPackages:
next: ^12.0.10 => 12.0.10
next-auth: ^3.27.3 => 3.27.3
react: ^17.0.2 => 17.0.2
Reproduction URL
nil
Describe the issue
Our application has a mobile app and web app. The mobile app is a react native app with a feathersJS server. The web app makes use of nextJS and the same feathersJS server. Currently sign up is possible only from the mobile app. The web app makes use of next-auth for sign in. Now we need to extend it to do sign up as well. We are trying to implement google, facebook and apple sign up to the nextJS application using next-auth. When we implemented google sign up, the idToken returned from next auth doesn't seem to contain profile information such as name and profile picture attributes in the payload which are vital for the way sign up is set up in our server. Is there a way to return the idToken with these details also included in it. So far we have tried editing the profile data and changing the scope of the provider which did not yield any useful result.
How to reproduce
Expected behavior
The expected payload of the idToken jwt should contain all the profile related information since the scope passes the profile.
Beta Was this translation helpful? Give feedback.
All reactions