google/google-api-javascript-client

Not working on real website, works on localhost

vforv opened this issue · 9 comments

vforv commented

Important gapi.auth2 notice: gapi.auth2 has been deprecated and replaced with Google Identity Services. Please see https://developers.google.com/identity/sign-in/web/deprecation-and-sunset for more information. If you have questions related to authentication/authorization please look at the associated documentation or post questions on Stack Overflow with the google-oauth tag.

Summary
Working on localhost not working on real domain. I added everything on app authorized domains also cleared cache

Browser(s)/Version(s)
Each

Expected Behavior
Login works as expected when testing on localhost but not on real website

Actual Behavior

On real website I getting error:

credential_button_library:48 [GSI_LOGGER]: The given origin is not allowed for the given client ID.
(anonymous) @ button?type=icon&width=200&client_id=115727459091-6eokr94phqi8if5u1puqmv3ns9su9dvn.apps.googleusercontent.com&iframe_id=gsi_686071_964241&as=0opUmcqLicF1Hq8qgx%2Fiig:1
m=credential_server_library:48 [GSI_LOGGER]: The given origin is not allowed for the given client ID

Steps to Reproduce
Please include steps and code samples to aid in issue reproduction(html/javascript).
I just using regular Angular implementation

Saggv commented

@vforv I have the same issue. Did you resolve it?
image

@vforv @Saggv I see the same issue, is this a configuration issue?
Did you get it resolved?

How do u solve it?

I solved this by following the instructions in this video: link.

I needed to add http://localhost (without a port) to the origins section of my Google OAuth credentials in google cloud.

I solved this by following the instructions in this video: link.

I needed to add http://localhost (without a port) to the origins section of my Google OAuth credentials in google cloud.

It works for me. Thanks.

Hi i'm still experiencing this issue.
Screenshot 2024-08-15 at 11 47 00 PM
Can someone help? I've added both localhost and localhost:3000 to my Authorized JavaScript origins.