Reputation: 729
I am using Python Social Auth package for consuming Google OAuth service. It works perfectly fine in my local machine. However, when I deployed the app on a VM linux machine, I get the following error:
AuthFailed at /complete/google-oauth2/
Authentication failed: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)
Exception Type: AuthFailed
Exception Value: Authentication failed: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by <class 'socket.gaierror'>: [Errno -2] Name or service not known)
Can Someone please help me? Thanks in advance.
Upvotes: 2
Views: 1273
Reputation: 334
I have recently used the same package for testing and was getting the same issue.
If you are using http://127.0.0.1:8000
to hit your server then replace it with http://localhost:8000/
followed by your URL path
Google requires HTTPS requests, so using localhost will represent a development server
This has solved the issue for me. I came across this solution from here https://youtu.be/wlcCvzOLL8w
Upvotes: 1