Given Origin is not allowed for the given client ID
Hi, I have checked through some of the earlier issues around the same topic, but I'm still getting the above error.
I have tried putting both server url and url with port number in the Google Authorized Origin, but it doesn't work for me.
However, localhost works though.
OAuth2 consent form has been filled up as well. Any hints on what else could be causing this error?
Could be something to do with the referral-policy given that the server url is http and not https. What do I need to do to set the referral-policy to no-referrer-when-downgrade?
I'm facing the same issue but in localhost, any idea? I already have configured http://localhost/ and http://localhost:3000/ in the Google Cloud console...
i ended up solving this by upgrading to https in all the servers...google will even detect that some servers in the entire request are not on https
Could be something to do with the referral-policy given that the server url is http and not https. What do I need to do to set the referral-policy to no-referrer-when-downgrade?
Same issue here. Not sure why.
Is there any solution for localhost?
I'm going through the same issue right now
@kkan0615 the issue for me was that localhost wasn't added on the javascript allowed origins in google admin
@kaiomagalhaes Thank you for sharing your solution 👍
I have my configuration in the google console of my test server but without an ssl certificate,
http://epint.mutualseg.cl/ and when I try to log in it shows me this error in the console: m=credential_button_library:49 [GSI_LOGGER]: The given origin is not allowed for the given client ID.
Now with the configuration for my http://localhost:3000 it works.
What could be happening?
@kkan0615 the issue for me was that localhost wasn't added on the javascript allowed origins in google admin
Authorized JavaScript origins For use with requests from a browser URIs 1 https://example.com URIs 2 http://localhost:3000
My set up is this in the Google Cloud console. It fails to work because when I click on the button in development, the modal opens to a blank and I get "The given origin is not allowed for the given client" in the console.
How did you solve this part?
Btw, it works in production only in Firefox and not in Chrome. In Firefox, the modal opens and I get options for Google Accounts.
@kkan0615 the issue for me was that localhost wasn't added on the javascript allowed origins in google admin
This worked for me. I already had http://localhost:5173 configured but I also had to add http://locahost and then it worked