guruahn / vue-google-oauth2

🔌 Handling Google sign-in and sign-out for Vue.js applications
MIT License
184 stars 55 forks source link

details: "You have created a new client application that uses libraries for user authentication or authorization that will soon be deprecated. New clients must use the new libraries instead; existing clients must also migrate before these libraries are deprecated. See the [Migration Guide](https://developers.google.com/identity/gsi/web/guides/gis-migration) for more information." error: "idpiframe_initialization_failed #78

Open Huucong95 opened 2 years ago

Huucong95 commented 2 years ago

image

Huucong95 commented 2 years ago

image

ahmedemarasure commented 2 years ago

Please fix, this is urgent problem

felipe1181 commented 2 years ago

fix it please

Luschor commented 2 years ago

Please fix it

MartensCedric commented 2 years ago

please fix it

SgtChrome commented 2 years ago

I am not sure, but doesn't #72 fix this?

Luschor commented 2 years ago

I am not sure, but doesn't #72 fix this?

Your fix is for python backend example. We need fix for Vue part.

diakonovm commented 2 years ago

Does anyone have a fix for this?

Luschor commented 2 years ago

Does anyone have a fix for this?

Still no solution.

tilenpirih commented 2 years ago

Fix please

Mudy7 commented 1 year ago

please fix

johnnative commented 1 year ago

Please fix

LeandroRM commented 1 year ago

Please fix

toct92 commented 1 year ago

Please fix

Luschor commented 1 year ago

If somebody only needs to get an auth code from google, here is a little workaround for a new google SDK implementation that works without plugin:

    script: [
      { src: 'https://accounts.google.com/gsi/client', async: true, defer: true }
    ]
yourFunction(){
  const client = google.accounts.oauth2.initTokenClient({
    client_id: 'YOUR_GOOGLE_CLIENT_ID',
    scope: 'https://www.googleapis.com/auth/userinfo.profile',
    callback: (response) => {
      ...
    },
  });
 }
shashankgaurav17 commented 1 year ago

Temporary fix for this is to add plugin_name to the config params

window.gapi.client
        .init({
          clientId:'Your Client ID',
          scope: "email",
          plugin_name:'App Name that you used in google developer console API'
        })

By default, new client IDs are now blocked from using the older platform library; existing client IDs are unaffected. New client IDs created before July 29th, 2022 may set the plugin_name to enable use of the legacy Google platform library.

sunjianbo945 commented 1 year ago

Does anyone have a fix for this?

pmadrigal95 commented 1 year ago

Hi,

Any update? I have the same issue :(

shumail786-hash commented 1 year ago

Any solution?????? I have the same issue :(

katana9108 commented 1 year ago

it is a horror... Any solution?

NyllRE commented 1 year ago

@Luschor

If somebody only needs to get an auth code from google, here is a little workaround for a new google SDK implementation that works without plugin:...

same error :/ image

Luschor commented 1 year ago

@Luschor

If somebody only needs to get an auth code from google, here is a little workaround for a new google SDK implementation that works without plugin:...

same error :/ image

You have to deactivate this plugin and use only my workaround.

guruahn commented 1 year ago

Thanks for your comments. We will review and work on the change as soon as possible.

NyllRE commented 1 year ago

@Luschor You have to deactivate this plugin and use only my workaround.

I forgot to tell you that this workaround did work, thanks!

I just wanted to ask about something else, is there a way to get the mobile app prompt? like when you try to sign in with google on a mobile app using something like Ionic. I don't think it's the best UX to transfer to a web page to sign in with google but all the answers were using java and I'm not experienced with java tbh

zhoudc1995 commented 1 year ago

Thanks for your comments. We will review and work on the change as soon as possible.

Please let me know after the modification is completed, thank you

Luschor commented 1 year ago

@NyllRE You probably want redirect mode instead popup window. So you need to use this function:

const client = google.accounts.oauth2.initCodeClient({
  client_id: 'YOUR_GOOGLE_CLIENT_ID',
  scope: 'https://www.googleapis.com/auth/userinfo.profile',
  ux_mode: 'redirect',
  redirect_uri: "https://your.domain/code_callback_endpoint",
  state: "YOUR_BINDING_VALUE"
});

More info here - https://developers.google.com/identity/oauth2/web/guides/use-code-model#redirect-mode

sadortun commented 1 year ago

@Luschor did you find a way to get the ID Token instead of the accessToken?

Luschor commented 1 year ago

@sadortun I think that GIS only returns an access token and auth code not ID token. Look here.

sadortun commented 1 year ago

@Luschor thanks,

The paragraph just above your link was exactly what I was looking for

Authentication only scopes Several scopes are used only for user authentication: email, profile, and openid. If your app only uses these scopes, consider if a JWT ID Token and Sign In With Google for user sign-up and sign-in meets your needs. In most cases, this is the most straightforward and simple method available for user authentication.


EDIT

For those who are still looking. If you need the ID Token (JWT Token)

Add <script src="https://accounts.google.com/gsi/client" async defer></script>

      // https://developers.google.com/identity/gsi/web/reference/js-reference?hl=fr#CredentialResponse

        google.accounts.id.initialize({
          client_id: 'CLIENT_ID',

          callback: response => {
                    const token = JSON.parse(atob(response.credential.split('.')[1]));
                   // ...
          },
        });
        google.accounts.id.prompt();
guruahn commented 1 year ago

This plugin does not support the new Google authentication system(GIS). You need to migrate by referring to this document. I'm sorry to tell you this news.

Zukhriddinbek-Code commented 7 months ago

I am using react-google-login and having the same error