0
votes

For a school project we are creating an timetable application.

Because we are using google, we decided to use google authentication for our application.

To access our API I need an ID token - But I'm unable to get the id token from google.

I'm using django with django-social-auth

Thanks in advance

EDIT:

The authentication itself is working. now I have to get the id token (Big JWT code)

SOCIAL_AUTH_GOOGLE_OAUTH2_KEY ='<<key>>'
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET = '<<secret>>'

SOCIAL_AUTH_GOOGLE_OAUTH2_SCOPES = (
    'https://www.googleapis.com/auth/plus.login',
    'https://www.googleapis.com/auth/plus.me',
    'https://www.googleapis.com/auth/userinfo.email',
    'https://www.googleapis.com/auth/userinfo.profile',
    'email')

SOCIAL_AUTH_GOOGLE_OAUTH2_AUTH_EXTRA_ARGUMENTS = {
    'access_type': 'offline',
    'response_type': 'code'
}

SOCIAL_AUTH_GOOGLE_OAUTH2_EXTRA_DATA = [ ('id', 'id') ]
1
Please provide additional information - any code you might have written, the versions of the resources you are using, specific failing use-cases, etc... Thanks and welocme to StackOverflow!Rann Lifshitz

1 Answers

0
votes

Go to google develop console and login.

After login, you can see user authentication information in the left menu (key icon).

You can make your own API key. Then use the key for google login in django admin. (then follow django-social-auth tutorial).