@@ -44,6 +44,8 @@ def load(configuration: "config.Configuration") -> "BaseAuth":
44
44
45
45
class BaseAuth :
46
46
47
+ _lc_username : bool
48
+
47
49
def __init__ (self , configuration : "config.Configuration" ) -> None :
48
50
"""Initialize BaseAuth.
49
51
@@ -53,6 +55,7 @@ def __init__(self, configuration: "config.Configuration") -> None:
53
55
54
56
"""
55
57
self .configuration = configuration
58
+ self ._lc_username = configuration .get ("auth" , "lc_username" )
56
59
57
60
def get_external_login (self , environ : types .WSGIEnviron ) -> Union [
58
61
Tuple [()], Tuple [str , str ]]:
@@ -67,7 +70,7 @@ def get_external_login(self, environ: types.WSGIEnviron) -> Union[
67
70
"""
68
71
return ()
69
72
70
- def login (self , login : str , password : str ) -> str :
73
+ def _login (self , login : str , password : str ) -> str :
71
74
"""Check credentials and map login to internal user
72
75
73
76
``login`` the login name
@@ -79,3 +82,6 @@ def login(self, login: str, password: str) -> str:
79
82
"""
80
83
81
84
raise NotImplementedError
85
+
86
+ def login (self , login : str , password : str ) -> str :
87
+ return self ._login (login , password ).lower () if self ._lc_username else self ._login (login , password )
0 commit comments