OAuth client not found. google login api
I want to use google-login api in my application, but I have 2 different errors.
1)Google login button is not rendering properly(Only render sometimes).
2)when my button shows up i got "The OAuth client was not found." on click in popup window.
My credentials for google login api:
Client ID :---> YOUR_CLIENT_ID
Client secret :--->voMrsqhFNBtnh5FUvqy-jorI
Redirect URIs :---->http://localhost:3000/
JavaScript origins :---> http://localhost:3000/
I have changed the name of the project many times. But it shows me the same error.
My HTML page is below.
<!doctype html>
<html lang="en" class="no-js">
<head>
<link rel="stylesheet" href="../Scripts/vendor/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="../css/github-fork.css">
<link rel="stylesheet" href="../css/bb-login.css">
<meta name="google-signin-client_id" content="YOUR_CLIENT_ID.apps.googleusercontent.com"
>
</head>
<body>
<div id="wrap">
<div class="header"></div>
<div id="content" class="container">
<script src="../Scripts/Vendor/requirejs/require.js" data-main="../Scripts/config.js"></script>
</div>
</div>
<script src="https://apis.google.com/js/client:platform.js?onload=start" ></script>
<script type="text/javascript">
function start() {
alert("inside start auth");
gapi.load('auth2', function() {
var auth2 = gapi.auth2.getAuthInstance();
alert(auth2);
});
if (auth2.isSignedIn.get()) {
alert("inside profile");
var profile = auth2.currentUser.get().getBasicProfile();
console.log('ID: ' + profile.getId());
console.log('Name: ' + profile.getName());
console.log('Image URL: ' + profile.getImageUrl());
console.log('Email: ' + profile.getEmail());
}
}
</script>
</body>
</html>
and I add mine <div class="g-signin2"></div>
to another template for backbone.js.
what is the problem?
source to share
The problem you are having is that Google API does not see you as a registered customer.
Google twitter and many other apps use OAuth 2.0, which means that you must be a registered and known client of the platform before using its API.
In your case, Google does not recognize you as an active customer, thus:
"The OAuth client was not found."
Make sure you are registered and verified by Google and that all credentials are correct.
source to share