I am using my corporate account (which is "Google for works" account) to implement Google oauth2.0 login in to my django application.
Pipeline in "settings.py" looks like:
SOCIAL_AUTH_PIPELINE = [
'social.pipeline.social_auth.social_details',
'social.pipeline.social_auth.social_uid',
'social.pipeline.social_auth.auth_allowed',
'social.pipeline.social_auth.associate_by_email',
'social.pipeline.social_auth.associate_user',
'social.pipeline.social_auth.load_extra_data',
'social.pipeline.user.user_details',
]
Adding conditional backends to pipepline.
if config.GCPAuthentication.AUTO_CREATE_ACCOUNTS:
SOCIAL_AUTH_PIPELINE.extend([
'social.pipeline.user.get_username',
'social.pipeline.user.create_user'
])
While trying to login for the very first time with a new user, I am getting error: AttributeError at /complete/google-oauth2/: 'NoneType' object has no attribute 'provider'
And interestingly, user is getting created and saved in DB and on next login attempt it allows me to login.
Its throwing error here : https://github.com/omab/python-social-auth/blob/master/social/actions.py#L70
My corporate Google account might not have any social account(Google+ is disabled)/related info associated with it. Is that an issue?
In any case, can you please tell me any workaround to get rid of this issue?