Skip to content

Custom OAuth authentication #78

Open
@simonwinter

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions