Been facing this issue "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 for more information." How to sign in with google now if they have block client ID for new users
Asked
Active
Viewed 1.8k times
10
-
1What is the problem? https://stackoverflow.com/help/how-to-ask – John Hanley May 10 '22 at 18:00
-
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community May 11 '22 at 00:00
-
I've added the screenshot. Anyone who can come up with the soultion – iamhsntariq May 12 '22 at 10:02
4 Answers
8
as google will deprecate their old sign in library https://developers.googleblog.com/2021/08/gsi-jsweb-deprecation.html
you can now implement their new google service identity SDK https://developers.google.com/identity/gsi/web
or if you are using react, I made a small package https://www.npmjs.com/package/@react-oauth/google it is using the new SDK

Mo'men Sherif
- 277
- 1
- 4
-
I have tried this library with new creds and it worked first try. Thanks! – Ruslan Plastun Aug 05 '22 at 08:29
2
I was having this issue and solved it using this answer
import React, { useEffect } from 'react';
import { GoogleLogin, GoogleLogout } from 'react-google-login';
import env from 'react-dotenv';
import { gapi } from 'gapi- script';
function AuthPage() {
useEffect(() => {
function start() {
gapi.client.init({
clientId: env.REACT_PUBLIC_GOOGLE_CLIENT_ID,
scope: 'email',
});
}
gapi.load('client:auth2', start);
}, []);
// **you can access the token like this**
// const accessToken = gapi.auth.getToken().access_token;
// console.log(accessToken);
const onSuccess = response => {
console.log('SUCCESS', response);
};
const onFailure = response => {
console.log('FAILED', response);
};
const onLogoutSuccess = () => {
console.log('SUCESS LOG OUT');
};
return (
<div>
<GoogleLogin
clientId={env.REACT_PUBLIC_GOOGLE_CLIENT_ID}
onSuccess={onSuccess}
onFailure={onFailure}
/>
<GoogleLogout
clientId={env.REACT_PUBLIC_GOOGLE_CLIENT_ID}
onLogoutSuccess={onLogoutSuccess}
/>
</div>
);
}
export default AuthPage;

Dawit Abraham
- 1,616
- 15
- 19
1
For angular developers, a repository with an example of how to use the new google sign in: https://github.com/ShemiNechmad/GoogleSignInAngular
Check the readme.md file for instructions.

Shem
- 258
- 2
- 8
-
Thanks! I'm just looking for the solution for older version of Angular. – Preeti Y. Mar 03 '23 at 07:11
0
I've faced the same issue, like you.
This is how I solved it in my React Application. https://stackoverflow.com/a/72944782/15145736
it will solve the problem

Suraj
- 802
- 9
- 7