wq.db icon indicating copy to clipboard operation
wq.db copied to clipboard

Custom OAuth authentication

Open simonwinter opened this issue 5 years ago • 0 comments

Hi there,

I'm attempting to use a custom Oauth2 based social auth backend as per https://python-social-auth.readthedocs.io/en/latest/backends/implementation.html#oauth

However, I am unable to get this to work. I've added the following:

  1. A class that implements BaseOAuth2
  2. Specified the class as an authentication backend:
AUTHENTICATION_BACKENDS = (
    'starterkit.backends.test.TestOAuth2',
    'django.contrib.auth.backends.ModelBackend',
)
  1. Updated the SOCIAL_AUTH_PIPELINE to include this:
SOCIAL_AUTH_PIPELINE = (
    'social_core.pipeline.social_auth.social_details',
    'social_core.pipeline.social_auth.social_uid',
    'social_core.pipeline.social_auth.auth_allowed',
    'starterkit.backends.test.TestOAuth2.user_data',
    'social_core.pipeline.social_auth.social_user',
    'social_core.pipeline.social_auth.associate_user',
    'social_core.pipeline.social_auth.load_extra_data',
    'social_core.pipeline.user.user_details',
)

My question is:

  1. Is this approach valid? Should I expect to add an authentication method to social auth?
  2. If it is, do you know if it's possible to enable some sort of logging to see what is going on under the hood?

This is likely an implementation on our code - I'm really checking that this approach is valid.

Thanks

simonwinter avatar May 12 '20 00:05 simonwinter