question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with OAuth redirect URI: http vs https mismatch

See original GitHub issue

Issue Summary

I’m following this guide: https://redash.io/help/open-source/admin-guide/google-developer-account-setup

To set up Redash on my server, which is running on docker compose via the Google Compute Engine instances that Redash provides on their website. I configured HTTPS according to this guide: https://gist.github.com/arikfr/64c9ff8d2f2b703d4e44fe9e45a7730e and I am setting up OAuth through Google

Steps to Reproduce

  1. Follow this guide exactly: https://redash.io/help/open-source/admin-guide/google-developer-account-setup
  2. Try and log in via OAuth

I received this error:

Error 400: redirect_uri_mismatch

The redirect URI in the request, http://[domain].com/oauth/google_callback, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: [URL]

My suspicion is that the redirect URI that redash provides is http, whereas the redirect URI that the Redash guide has my type into Google is https. This error vanished after I changed the authorized URL for my OAuth Client to the http url, however I received a different error, an Internal Server Error in the Redash app and, in the logs, OAuthException: Invalid response from google. Not sure if this is an unrelated issue, but this http/https change is inconsistent with the Google OAuth docs at the very least.

Technical details:

  • Redash Version: 5.0.2
  • Browser/OS: Firefox / Debian 10
  • How did you install Redash: See above

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
arikfrcommented, Aug 11, 2019

@alexwennerberg sounds like the nginx doesn’t pass the correct protocol to the Python code. Can you try changing line 61 in nginx.conf from:

proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;

to:

proxy_set_header X-Forwarded-Proto $scheme;
0reactions
zhongshaoming1commented, Sep 20, 2022

Thanks master!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google OAuth 2 authorization - Error: redirect_uri_mismatch
The redirect URI (where the response is returned to) has to be registered in the APIs console, and the error is indicating that...
Read more >
Error AADSTS50011 the redirect URI not match the redirect ...
This error occurs if the redirect URI that the application sent doesn't match any of the redirect URIs that are registered on the...
Read more >
OAuth fail: http:// vs https:// mismatch! - WordPress.org
It is obvious to me that this redirect issue stems from the mismatch between the http:// scheme in the plugin vs. the google...
Read more >
Solved: Receiving a "redirect_uri_mismatch" error when aut...
I'm trying to use OAUTH 2.0 to authenticate/authorize. I'm testing on my local machine, where my application is running and accessible over HTTPS....
Read more >
Google OAuth 2 authorization - Error redirect uri mismatch
To answer your question, you need to redirect URI where the response is returned and has to be registered in the APIs console,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found