Google Auth Provider - get photo and name/surname

System Information
  • macOS Monterey 12.3:
  • strapi 4.0.7:
  • sqllite:
  • node 14.17.6:
  • yarn 1.22.11:

Hi everyone!

Is there a way to get more info (like name/surname and user photo) using standart stapi google provider, or i have to write custom provider?

If its all about “custom-way”, could anyone please provide me with some guide how to make it. Or maybe someone had similar experience?

Thanks in advance!

Hey take a look here : [Auth Providers] how to add scope for google - Questions and Answers / Strapi Backend - Strapi Community Forum



So i’ve created Providers.js and added bootstrap in index.js as in tread you linked.
But its not overriding providers from node_modules

Maybe i have to do something differently because im using v4 of strapi


It’s possible so go to the source code to see where the file is located. Maybe it’s different

Also, only accounts création will use the New code, so maybe remove existing accounts and try again.


I tried official guide + everything from the tread you linked (including your last answer about creating new user, cleaning user collection)

Added bootstrap.js and Providers.js as it mentioned:


also added bootstrap function in src/index.js

  async bootstrap({ strapi }) {
    const pluginStore ={
      environment: '',
      type: 'plugin',
      name: 'users-permissions',
    // Ensure profile scope for Google Auth
    const grantConfig = await pluginStore.get({ key: 'grant' })
      if( &&{ = ['openid', 'email', 'profile']
        await pluginStore.set({ key: 'grant', value: grantConfig });

Still no result :cry:

May you try this :

case 'google': {
      const instance = axios.create({
        baseURL: '',
        headers: {'Authorization': 'Bearer ' + access_token }

      instance.get('userinfo').then(x =>  {
        callback(null, {
      }, err => callback(err));

In Provider.js

Any update on this one?

It think one problem is that the override files are not called and the other one is that even providing additional options to scopes like profile doesn’t really influence what data are returned. I have extended scoped to return openid and profile additionally and then console.log what will returned and I get only some token info. I have tried to change line 117 on @KevichVinc screenshot to userinfo but then I get 404, so I think it’s an invalid option.

By default response body equals to:

body: {
    issued_to: '',
    audience: '',
    user_id: '1234567890',
    scope: 'openid',
    expires_in: 3598,
    email: '',
    verified_email: true

EDIT: thanks to this reply Changes for Google auth provider · Issue #2660 · strapi/strapi · GitHub, one need to change google URL in order to get profile info in the response as follows:

        .request(({body}) => ({
              // put here your additional keys
1 Like

Version : 4.11.3

There is a functional code to add picture, first name etc in the Google sign-in with the Strapi provider

Put this code in the src/index.js

"use strict";

module.exports = {
  register(/*{ strapi }*/) {},
  async bootstrap({ strapi }) {
    await strapi
      .register(`google`, ({ purest }) => async ({ query }) => {
        const google = purest({ provider: "google" });

        const res = await google

        const { body } = res;

        return {
          firstname: body.given_name,
          lastname: body.family_name,
          picture: body.picture,
          provider: "google",

Wow! You saved me a lot of time @Berrier_Joffrey
Great help

1 Like

Great post. I would like to share these online services related to photographs: