google / google-api-javascript-client

Google APIs Client Library for browser JavaScript, aka gapi.
Apache License 2.0
3.23k stars 1.07k forks source link

Not working on real website, works on localhost #1159

Open vforv opened 1 year ago

vforv commented 1 year ago

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 12 months ago

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

image
sudarshanch commented 11 months ago

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

Shirripitinsex commented 11 months ago

Saludos no he logrado resolver mi problema

El vie, 22 de dic de 2023 8:45 a. m., Sudarshan Chippa < @.***> escribió:

@vforv https://github.com/vforv @Saggv https://github.com/Saggv I see the same issue, is this a configuration issue? Did you get it resolved?

— Reply to this email directly, view it on GitHub https://github.com/google/google-api-javascript-client/issues/1159#issuecomment-1867885648, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3EUDQDSXXBZR2ARKUAN6LTYKW2LTAVCNFSM6AAAAAA7GSI76SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRXHA4DKNRUHA . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>

EniovdgDev commented 10 months ago

How do u solve it?

vittxr commented 7 months ago

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.

hanweixing commented 6 months ago

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.

nitinramvelraj commented 3 months ago

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.