misc: set a default authentication backend priority (#45808)
This commit is contained in:
parent
a66093a5dc
commit
7c2c6db430
|
@ -57,6 +57,7 @@ class BaseAuthenticator(object):
|
|||
class LoginPasswordAuthenticator(BaseAuthenticator):
|
||||
id = 'password'
|
||||
submit_name = 'login-password-submit'
|
||||
priority = 0
|
||||
|
||||
def enabled(self):
|
||||
return app_settings.A2_AUTH_PASSWORD_ENABLE
|
||||
|
|
|
@ -203,7 +203,7 @@ def get_backends(setting_name='IDP_BACKENDS'):
|
|||
else:
|
||||
backend.name = None
|
||||
if not hasattr(backend, 'priority'):
|
||||
backend.priority = 0
|
||||
backend.priority = 999 # backend with undefined priority go last
|
||||
if backend.id and backend.id in kwargs_settings:
|
||||
kwargs.update(kwargs_settings[backend.id])
|
||||
backend.__dict__.update(kwargs)
|
||||
|
|
|
@ -26,7 +26,7 @@ from authentic2.authenticators import BaseAuthenticator
|
|||
|
||||
class OIDCAuthenticator(BaseAuthenticator):
|
||||
id = 'oidc'
|
||||
|
||||
priority = 2
|
||||
|
||||
def enabled(self):
|
||||
return app_settings.ENABLE and utils.has_providers()
|
||||
|
|
|
@ -27,6 +27,7 @@ from . import app_settings
|
|||
|
||||
class SAMLAuthenticator(BaseAuthenticator):
|
||||
id = 'saml'
|
||||
priority = 3
|
||||
|
||||
def enabled(self):
|
||||
return app_settings.enable and list(get_idps())
|
||||
|
|
Loading…
Reference in New Issue