mirror of
https://github.com/ansible/awx.git
synced 2026-01-28 23:04:41 -03:30
Force the username and password to be strings under the Radius backend
The base Radius backend encodes them as utf-8 bytes, which causes the User object that we create to get the repr of the username, including the b prefix and single quotes, e.g. "b'foo'".
This commit is contained in:
parent
a691340986
commit
172864a3a1
@ -13,6 +13,7 @@ from django.dispatch import receiver
|
||||
from django.contrib.auth.models import User
|
||||
from django.conf import settings as django_settings
|
||||
from django.core.signals import setting_changed
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
# django-auth-ldap
|
||||
from django_auth_ldap.backend import LDAPSettings as BaseLDAPSettings
|
||||
@ -209,7 +210,7 @@ class RADIUSBackend(BaseRADIUSBackend):
|
||||
return user
|
||||
|
||||
def get_django_user(self, username, password=None):
|
||||
return _get_or_set_enterprise_user(username, password, 'radius')
|
||||
return _get_or_set_enterprise_user(force_text(username), force_text(password), 'radius')
|
||||
|
||||
|
||||
class TACACSPlusBackend(object):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user