1

I'm trying to add Google sign-in in my website, I made an Oauth Client on Google Cloud Platform but I can't add my javascript url as an allowed source.

I'm getting Erreur 400 : redirect_uri_mismatch https://________.script.googleusercontent.com, does not match the ones authorized for the OAuth client. Visit https://console.developers.google.com/apis/credentials/oauthclient/______.apps.googleusercontent.com?project=______ to update the authorized JavaScript origins.

I'm using Apps script to developp it and https://script.google.com doesn't work as an allowed source for the oauth client.

Does someone has a solution ? Is there a way to make it work ?

Edit : my situation is similar to this post : Google Sign in redirect_uri_mismatch, however I can't add any URL looking like this. Google Platform does'nt allow them.

Audrey C
  • 11
  • 2
  • 1
    Please refer this answer - https://stackoverflow.com/questions/21971318/how-to-use-oauth-2-0-for-web-server-applications/ – yogihosting Jun 23 '21 at 10:24
  • Thank you for your answer, however the answer you shared didn't seem to have a solution for my problem. – Audrey C Jun 24 '21 at 07:43
  • I found the answer to my problem. There is no solution to this problem since October, here is links for more details : What is the Authorized Javascript Origin for a webapp powered by Google Script? and : https://issuetracker.google.com/issues/170740549?pli=1 – Audrey C Jun 24 '21 at 12:31

1 Answers1

1

The redirect uri must exactly match the location which you are prepared to respond to the oauth consent.

In this case its https://.script.googleusercontent.com you should add that as a redirect uri in your project.

This might explain the issue How the fix redirect_uri_mismatch error. Part 2 server sided web applications.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • Thank you for your answer and I watched the video. I already tried adding this url but it is not accepted. It says : Invalid origin: uses a forbidden domain. – Audrey C Jun 23 '21 at 12:46
  • A website using the same method with Apps Script ran well and it was accepting this type of url. Now the url is shown as wrong but already registered, this website still function. So I wanted to know if someone uncountered the same issue recently ? – Audrey C Jun 23 '21 at 13:07