Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google API OAuth 2 and Django

I work on a project with Django, Google API Calendar and OAuth 2 and I have the follow error:

(insecure_transport) OAuth 2 MUST utilize https.

When I set the redirect_uri with google_auth_oauthlib.flow.Flow, the URI that I set is: http://localhost:8000/google/oauthcallback.

like image 890
Alexandro Avatar asked Oct 31 '25 20:10

Alexandro


1 Answers

The error states to use a HTTPS connection which you can either set one with an SSL certificate or allow a HTTP connection in the environment like so:

import os 
os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'

From this answer

like image 188
FluxedScript Avatar answered Nov 03 '25 09:11

FluxedScript



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!