Open Huucong95 opened 2 years ago
Please fix, this is urgent problem
fix it please
Please fix it
please fix it
I am not sure, but doesn't #72 fix this?
I am not sure, but doesn't #72 fix this?
Your fix is for python backend example. We need fix for Vue part.
Does anyone have a fix for this?
Does anyone have a fix for this?
Still no solution.
Fix please
please fix
Please fix
Please fix
Please fix
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 }
]
call google function on button click:
yourFunction(){
const client = google.accounts.oauth2.initCodeClient({
client_id: 'YOUR_GOOGLE_CLIENT_ID',
scope: 'https://www.googleapis.com/auth/userinfo.profile',
ux_mode: 'popup',
callback: (response) => {
if(response.code){
console.log(response.code)
}
},
});
client.requestCode();
}
similar solution for getting an access token:
yourFunction(){
const client = google.accounts.oauth2.initTokenClient({
client_id: 'YOUR_GOOGLE_CLIENT_ID',
scope: 'https://www.googleapis.com/auth/userinfo.profile',
callback: (response) => {
...
},
});
}
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.
Does anyone have a fix for this?
Hi,
Any update? I have the same issue :(
Any solution?????? I have the same issue :(
it is a horror... Any solution?
@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 :/
@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 :/
You have to deactivate this plugin and use only my workaround.
Thanks for your comments. We will review and work on the change as soon as possible.
@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
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
@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
@Luschor did you find a way to get the ID Token
instead of the accessToken
?
@sadortun I think that GIS only returns an access token and auth code not ID token. Look here.
@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();
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.
I am using react-google-login and having the same error