Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8093583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:31:58+00:00 2026-06-05T20:31:58+00:00

I recently added an extra authentication backend to allow users to login using either

  • 0

I recently added an extra authentication backend to allow users to login using either their email address or username, but it seems to break django-social-auth since after enabling it, when I try to login through Facebook, I get the message Incorrect authentication service

The backend’s code is:

class EmailBackend:
    supports_object_permissions = False
    supports_anonymous_user = False
    supports_inactive_user = False 

    def authenticate(self, username=None, password=None):
        if email_re.search(username):
            try:
                user = User.objects.get(email=username)
            except User.DoesNotExist:
                return None
        else:
            try:
                user = User.objects.get(username=username)
            except User.DoesNotExist:
                return None
        if user.check_password(password):
            return user
        return None

    def get_user(self, user_id):
        try:
            return User.objects.get(pk=user_id)
        except User.DoesNotExist:
            return None

I got the code snippet from Django snippets

My AUTHENTICATION_BACKENDS:

AUTHENTICATION_BACKENDS = (
    'social_auth.backends.twitter.TwitterBackend',
    'social_auth.backends.facebook.FacebookBackend',
    'apps.members.backends.EmailBackend',
)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:31:59+00:00Added an answer on June 5, 2026 at 8:31 pm

    I’ve successfully used an email auth backend with django-social-auth. I don’t remember having done anything special for it to work so it might be something non obvious, here are the only differences I can see with my code :

    I had my Email backend defined first in he list of AUTHENTICATION_BACKENDS, which may have some importance here.

    I did not define any of the supports_object_permissions supports_anonymous_user supports_inactive_user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently added a :title column using Rails migration: class AddTitleToMicroposts < ActiveRecord::Migration def
We recently added auditing to our database. A colleague implemented it using triggers and
Hey all, I have the following problem. I recently added an extra column to
I recently added a new column called auth_token to my users which is suppose
I recently added a new model to my site, and I'm using an admin.py
I know the feature doesn't exist in C#, but PHP recently added a feature
Recently added log4net.dll to our data object. Our data object builds perfectly but when
I recently added a feature to a large application written in Delphi (version 2009)
I recently added these lines to my ~/.bashrc file to show the current branch
I recently added CKEditor to my app and I would like to include my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.