mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 00:09:17 +02:00
Implement LDAP authentication
This commit is contained in:
parent
6ed5740f6f
commit
4ce46ff2a0
17 changed files with 232 additions and 15 deletions
|
@ -33,7 +33,7 @@ class FederationMixin(object):
|
|||
|
||||
|
||||
class ActorViewSet(FederationMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet):
|
||||
lookup_field = "user__username"
|
||||
lookup_field = "preferred_username"
|
||||
lookup_value_regex = ".*"
|
||||
authentication_classes = [authentication.SignatureAuthentication]
|
||||
permission_classes = []
|
||||
|
@ -136,7 +136,7 @@ class WellKnownViewSet(viewsets.GenericViewSet):
|
|||
actor = actors.SYSTEM_ACTORS[username].get_actor_instance()
|
||||
else:
|
||||
try:
|
||||
actor = models.Actor.objects.local().get(user__username=username)
|
||||
actor = models.Actor.objects.local().get(preferred_username=username)
|
||||
except models.Actor.DoesNotExist:
|
||||
raise forms.ValidationError("Invalid username")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue