Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google OAUTH gives 502 error

Tags:

http

django

oauth

I am successful in authenticating users locally, but on the production server I am receiving 502 errors after timeout..

here is my FLOW:

FLOW = OAuth2WebServerFlow(
        client_id='YOUR_CLIENT_ID',
        client_secret='YOUR_CLIENT_SECRET',
        scope='https://www.googleapis.com/auth/calendar',
        user_agent='Real_Hub/1.0',
        redirect_uri='quickerhub.com',)

locally redirect_uri is simply my localhost ip and it works fine.

here is my error through chrome network panel:

quickerhub.com
GET
502
Bad Gateway
text/html
like image 759
ljrh Avatar asked Feb 23 '26 03:02

ljrh


1 Answers

This likely has to do with your redirect_uri. 502 is a very general error. It indicates that Django (probably uWSGI or Passenger) was unable to get a response before timeout. Have you tried that uri directly in your browser? If you have any HTTP authentication or anything on that domain, it will cause this error. For some reason, the OAuth does not seem to be properly creating the redirect response.

Hope this helps!

like image 73
Jamie Counsell Avatar answered Feb 26 '26 00:02

Jamie Counsell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!