I am trying to get google oauth working on my php webapp. I'm in dev, on a centos LAMP environment with a URL that is configured to http://centos-myapp.com
via /etc/hosts
on Windows.
On https://console.cloud.google.com/apis/credentials/oauthclient
I have set up a clientid for my app using the http://centos-myapp.com
[Authorised Javascript orgins] URL,
and a dummy Authorised redirect URIs url to http::/localhost/index.php
(as I can't seem to use http://centos-myapp.com ... as it wanted https)
When I run the http://centos-myapp.com page - I see the "Sign in with Google" button from the g_id_onload structure
<div id='g_id_onload'
data-client_id='$google_clientId'
data-login_uri='http://centos-myapp.com'
data-auto_prompt='false'>
</div>
<div class='g_id_signin'
data-type='$googleLoginType'
data-size='$googleLoginSize'
data-theme='$googleLoginTheme'
data-text='$googleLoginText'
data-shape='$googleLoginShape'
data-logo_alignment='$googleLoginType'>
</div>
but when I click on this button I get the expected new window - but it's empty and the console reads: m=credential_page_library:48 [GSI_LOGGER]: The given origin is not allowed for the given client ID.
Am I doing something wrong? Am I not allowed to have a dev environment not named localhost?
source https://stackoverflow.com/questions/77559198/credential-page-library48-gsi-logger-the-given-origin-is-not-allowed-for-the
No comments:
Post a Comment