T
Twenty4mo ago
A

Error 404: redirect_uri_mismatch - Google Auth

Sometimes when logging in, an error is thrown stating the following: This is depsite, as shown attached, the following redirect URLs being specified (is there any documentation on this as I have not found anything clear)?....
Error 400: redirect_uri_mismatch

You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.

If you're the app developer, register the redirect URI in the Google Cloud Console.
Request details: response_type=code redirect_uri=http://localhost:3000/auth/google/redirect state={} prompt=select_account client_id=180645751<redacted>.apps.googleusercontent.com access_type=online scope=https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid
Error 400: redirect_uri_mismatch

You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.

If you're the app developer, register the redirect URI in the Google Cloud Console.
Request details: response_type=code redirect_uri=http://localhost:3000/auth/google/redirect state={} prompt=select_account client_id=180645751<redacted>.apps.googleusercontent.com access_type=online scope=https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile openid
In Docker Compose, I have set
IS_SIGN_UP_DISABLED: ${IS_SIGN_UP_DISABLED}
MESSAGING_PROVIDER_GMAIL_ENABLED: ${MESSAGING_PROVIDER_GMAIL_ENABLED}
CALENDAR_PROVIDER_GOOGLE_ENABLED: ${CALENDAR_PROVIDER_GOOGLE_ENABLED}
AUTH_GOOGLE_APIS_CALLBACK_URL: ${AUTH_GOOGLE_APIS_CALLBACK_URL}
AUTH_GOOGLE_ENABLED: ${AUTH_GOOGLE_ENABLED}
AUTH_GOOGLE_CLIENT_ID: ${AUTH_GOOGLE_CLIENT_ID}
AUTH_GOOGLE_CLIENT_SECRET: ${AUTH_GOOGLE_CLIENT_SECRET}
AUTH_GOOGLE_CALLBACK_URL: ${AUTH_GOOGLE_CALLBACK_URL}
SIGN_IN_PREFILLED: ${SIGN_IN_PREFILLED}
IS_SIGN_UP_DISABLED: ${IS_SIGN_UP_DISABLED}
MESSAGING_PROVIDER_GMAIL_ENABLED: ${MESSAGING_PROVIDER_GMAIL_ENABLED}
CALENDAR_PROVIDER_GOOGLE_ENABLED: ${CALENDAR_PROVIDER_GOOGLE_ENABLED}
AUTH_GOOGLE_APIS_CALLBACK_URL: ${AUTH_GOOGLE_APIS_CALLBACK_URL}
AUTH_GOOGLE_ENABLED: ${AUTH_GOOGLE_ENABLED}
AUTH_GOOGLE_CLIENT_ID: ${AUTH_GOOGLE_CLIENT_ID}
AUTH_GOOGLE_CLIENT_SECRET: ${AUTH_GOOGLE_CLIENT_SECRET}
AUTH_GOOGLE_CALLBACK_URL: ${AUTH_GOOGLE_CALLBACK_URL}
SIGN_IN_PREFILLED: ${SIGN_IN_PREFILLED}
4 Replies
A
A4mo ago
Unsure if the redirect URL params are the issue here on not in the above screenshot? The docker values are:
IS_SIGN_UP_DISABLED=false
MESSAGING_PROVIDER_GMAIL_ENABLED=true
CALENDAR_PROVIDER_GOOGLE_ENABLED=true
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID="18064575<redacted>apps.googleusercontent.com"
AUTH_GOOGLE_CLIENT_SECRET="GOCSPX-<redacted>"
AUTH_GOOGLE_CALLBACK_URL=${SERVER_URL}/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=${SERVER_URL}/auth/google-apis/get-access-token
SIGN_IN_PREFILLED=false
IS_SIGN_UP_DISABLED=false
MESSAGING_PROVIDER_GMAIL_ENABLED=true
CALENDAR_PROVIDER_GOOGLE_ENABLED=true
AUTH_GOOGLE_ENABLED=true
AUTH_GOOGLE_CLIENT_ID="18064575<redacted>apps.googleusercontent.com"
AUTH_GOOGLE_CLIENT_SECRET="GOCSPX-<redacted>"
AUTH_GOOGLE_CALLBACK_URL=${SERVER_URL}/auth/google/redirect
AUTH_GOOGLE_APIS_CALLBACK_URL=${SERVER_URL}/auth/google-apis/get-access-token
SIGN_IN_PREFILLED=false
charles
charles4mo ago
Hi @A, you are facing this issue inconsistently? This is weird, Your redirect URLs do need to be setup I know that it takes some times (between a few mins to hours) for Google to deploy the change to ALL its servers. So maybe it was working on a few server but not on others and that's why you had the issue
A
A4mo ago
Interesting @charles ok, thanks for getting back to me 🙂 I think I have setup all the redirect URLs required, on a first glance does everything appear to be in check to you?
charles
charles4mo ago
yes, looks good to me, still facing issues?
Want results from more Discord servers?
Add your server