Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Redirect_uri mismatch issue

Hi there,

I'm using Userfront to handle my email/password auth and Google SSO. Recently, I've taken steps to move the app to production and had to verify it with Google. Since I have to own domains that are used for redirection I can't use api.userfront.com as I have used during testing. Support as Userfront told me to create a CNAME dns entry pointing to their validation url and also instructed me to use [mytenantid].mydomain.co as a redirect uri which will resolve correctly. After passing verification with Google my App's Google SSO is broken since I'm getting redirect_uri mismatch error. It says that it tries to go to api.userfront.com but I don't have that uri registered as authorised uri.

Also when I debug using a premade url with my client id, redirect uri and auth method with google, I get the correct consent screen but it still errors out. Sometimes nothing happens, sometimes I get token errors and sometimes I get the uri mismatch.

I'm puzzled at what to do next. Does anyone has any idea on how to proceed here? Thanks 

1 1 8,082
1 REPLY 1

Hi @semirte,

Welcome to Google Cloud Community!

I've managed to replicate your issue.
Screenshot 2023-02-02 5.07.45 AM.png

You must change the redirect URI in the Google API Console to correspond with the one you are using in your app in order to fix the redirect URI mismatch issue (Userfront). The redirect URI must match exactly, down to the letter cases. Additionally, you must ensure that the URI you use in your app is correctly structured and adheres to the format requirements listed in the API Console. If the problem persists, you can try using a different browser or deleting your browser's cache to see if that helps.

From the Userfront Dashboard > Authentication Tab > Configure SSO (single sign-on) providers > Redirect URL
Screenshot 2023-02-02 5.10.52 AM.png

You must copy it to Google API Console. API & Services > Credentials > OAuth 2.0 Client IDs > Click on you Client ID > then add the Redirect URL

christianpaula_0-1675286170009.png

Thank you