Redirect URI mismatch error from Google OAuth

I have a Flask web application which is hosting in Google Cloud Run which is hosted with https://mydomain.run.app.

Now I am trying to add google authentication to it. I have created the API under credentials in GCP. I have given https://mydomain.run.app/authorize in the redirect uri but when I tried to login from my app it throws me redirect mismatch error. And the error shows me http://mydomain.run.app/authorize. The mismatch is the https and http When I tried to give http in the credentials uri it throws me

Invalid Redirect: This app has a publishing status of "In production". URI must use https:// as the scheme.

2 answers

  • answered 2021-10-24 15:20 Thanh Nguyen Van

    Under Authorized redirect URIs

    You should put 1 more URI :

    https://mydomain.run.app/
    

    Then check again. I have got same issue before.

  • answered 2021-10-24 19:24 DaImTo

    your app is currently set to production in google developer console.

    enter image description here

    This means that all of the redirect uris you try to add to your project. Must be HTTPS and not HTTP you can also not use localhost

    As you are trying to use http://mydomain.run.app/authorize you need to change it so that it is https://mydomain.run.app/authorize note that the first one was http:// and not https://

    The error is coming because your application itself is trying to send a redirect uri of http and not https. You need to fix your application so that it is using https.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum