Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question understanding how auth_backends work #598

Open
maxwyb opened this issue Aug 1, 2017 · 0 comments
Open

Question understanding how auth_backends work #598

maxwyb opened this issue Aug 1, 2017 · 0 comments

Comments

@maxwyb
Copy link

maxwyb commented Aug 1, 2017

I am new to Django and am trying to understand how the customized authentication backend works in this case (Sorry if the question is too simple). In django_facebook/auth_backends.py, we have an authenticate function with facebook_id and facebook_email as parameters.

def authenticate(self, facebook_id=None, facebook_email=None):

However, according to Django's official documentation:

The authenticate method takes a request argument and credentials as keyword arguments. Most of the time, it’ll just look like this:

class MyBackend(object):
    def authenticate(self, request, username=None, password=None):
        # Check the username/password and return a user.
        ...

So the method signature does not match Django's specification; how does it work correctly?

Also, I did notice that in django_facebook/registration_backends.py, there is another authentication function in class FacebookRegistrationBackend(NooptRegistrationBackend) that matches the documentation. Is this related to the authentication backend? And what is the relation between an "authentication backend" and a "registration backend"?

Thanks, appreciate your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant