Harshit Laddha
Harshit Laddha

Reputation: 2124

Django allauth linkedin login with oauth 2.0 updated scopes

I am trying to add a "Sign In with Linkedin" button in a django site with allauth. I tried adding the following configuration to the social providers setting -

'linkedin_oauth2': {
        'SCOPE': [
            'openid',
            'profile',
            'email'
        ],
        'FIELDS': [
            'id',
            'name',
            'given_name',
            'family_name',
            'email',
            'picture'
        ],
        'PROFILE_FIELDS': [
            'id',
            'name',
            'given_name',
            'family_name',
            'email',
            'picture'
        ],
        'VERIFIED_EMAIL': True
    }

I also tried by removing all fields and profile fields and I get a code successfully on the redirect url but I think it fails for some reason either when exchanging the code for a token or mapping the profile fields. I don't see any errors in logs but I see

Social Network Login Failure
An error occurred while attempting to login via your social network account.

on the callback url.

I also tried adding the old scopes - r_liteprofile|r_basicprofile|r_emailaddress but all those scopes throw an error stating that the scope is not authorized for my application.

Upvotes: 0

Views: 252

Answers (0)

Related Questions