2

I'd created a django project for sign in with google using django-social-auth.

I'd followed the doc and created an app in google developer console with "OAuth 2.0" and added API's of

Gmail API, Google+ API,  Google+ Domains API and Google+ Hangouts API

In Credentials I've set up AUTHORIZED REDIRECT URIS to my production server url "mysite.com".

I'd configured django settings with the "CLIENT ID" and "CLIENT SECRET". This set up works perfectly on my local server, user is created and the email is associated for the user.

But when I moved to the production server, I get the error

"400. That’s an error. OpenID auth request contains an unregistered domain: mysite.com". 

Did any one else faces a similar issue?

Kishore K
  • 1,887
  • 2
  • 14
  • 18
  • possible duplicate of [Changed domain error - OpenId auth request contains an unregistered domain](http://stackoverflow.com/questions/23773275/changed-domain-error-openid-auth-request-contains-an-unregistered-domain) – abraham Mar 25 '15 at 03:10
  • I'd created google app with OAuth 2.0 and it is still not working. – Kishore K Mar 25 '15 at 04:20
  • It's not the app you create with Google, it's how your code tries to auth. Note that django-social-auth is "deprecated in favor of python-social-auth" so it may very well not be using the current Google APIs. – abraham Mar 25 '15 at 04:28

1 Answers1

5

I also had the similar issue and I fixed it as follows:

  1. If your google login URL is /login/google/, change it to /login/google-oauth2/
  2. Add the following redirect URIs in your google app settings

http://<your domain>/<social-auth-prefix-if-any>/complete/google-oauth2/ http://<your domain>/<social-auth-prefix-if-any>/associate/complete/google-oauth2/

Hope this helps.

sreekanth
  • 660
  • 1
  • 6
  • 11