GithubHelp home page GithubHelp logo

Comments (4)

CrystalCat avatar CrystalCat commented on June 10, 2024

hi~
trace login process. it turns out it may be hue's AllowAllBackend not implements Django3.x auth backend implementation.

in build/env/lib/python3.8/site-packages/django/contrib/auth/init.py
line 64~74

def authenticate(request=None, **credentials):
    """
    If the given credentials are valid, return a User object.
    """
    for backend, backend_path in _get_backends(return_tuples=True):
        backend_signature = inspect.signature(backend.authenticate)
        try:
            backend_signature.bind(request, **credentials)
        except TypeError as e:
            # This backend doesn't accept these credentials as arguments. Try the next one.
            raise e

it called by build/env/lib/python3.8/site-packages/django/contrib/auth/forms.py line 202

self.user_cache = authenticate(self.request, username=username, password=password)

AllowAllBackend.authenticate(username,password) inhers from DesktopBackendBase only accept 2 arguments.

##  desktop/core/src/desktop/auth/backend.py

class DesktopBackendBase(object):
  """
  Abstract base class for providing external authentication schemes.

  Extend this class and implement check_auth
  """
  def authenticate(self, username, password):
    if self.check_auth(username, password):
      user = find_or_create_user(username)
      user = rewrite_user(user)
      return user
    else:
      return None

it will raise error TypeError("multiple values for argument 'username'") while invoke backend_signature.bind(request, **credentials) , DesktopBackendBase. authenticate method need some change to play with Django3.x

from hue.

bjornalm avatar bjornalm commented on June 10, 2024

@CrystalCat thanks for your detailed bug report. Since Hue is open source and the core team has limited time on their hands, would you be interested in creating a PR for this so that they could have a look?

from hue.

CrystalCat avatar CrystalCat commented on June 10, 2024

@bjornalm thanks,I'll try to create a PR for this problem. closing

from hue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.