0003-multifactor-totp-turn-plugin-into-app.patch
setup.py | ||
---|---|---|
176 | 176 |
'authentic2-idp-oidc = authentic2_idp_oidc:Plugin', |
177 | 177 |
'authentic2-provisionning-ldap = authentic2_provisionning_ldap:Plugin', |
178 | 178 |
'authentic2-auth-fc = authentic2_auth_fc:Plugin', |
179 |
'authentic2-auth-oath = authentic2.auth2_multifactor.auth_oath:Plugin', |
|
180 | 179 |
], |
181 | 180 |
}) |
src/authentic2/auth2_multifactor/auth_oath/__init__.py | ||
---|---|---|
1 |
class Plugin(object): |
|
2 |
def get_before_urls(self): |
|
3 |
from . import app_settings |
|
4 |
from django.conf.urls import include, url |
|
5 |
from authentic2.decorators import setting_enabled, required |
|
6 | ||
7 |
return required( |
|
8 |
setting_enabled('ENABLE', settings=app_settings), |
|
9 |
[url(r'^accounts/authenticators/totp/', include(__name__ + '.urls'))]) |
|
10 | ||
11 |
def get_apps(self): |
|
12 |
return [__name__] |
|
13 | ||
14 |
def get_authenticators(self): |
|
15 |
return ['authentic2.auth2_multifactor.auth_oath.authenticators.TOTPAuthenticator'] |
src/authentic2/settings.py | ||
---|---|---|
145 | 145 |
'xstatic.pkg.jquery', |
146 | 146 |
'xstatic.pkg.jquery_ui', |
147 | 147 |
'xstatic.pkg.select2', |
148 |
'authentic2_mfa_totp', |
|
148 | 149 |
) |
149 | 150 | |
150 | 151 |
INSTALLED_APPS = tuple(plugins.register_plugins_installed_apps(INSTALLED_APPS)) |
... | ... | |
174 | 175 |
# Authentication settings |
175 | 176 |
########################### |
176 | 177 |
AUTH_USER_MODEL = 'custom_user.User' |
177 |
AUTH_FRONTENDS = plugins.register_plugins_authenticators(( |
|
178 |
'authentic2.authenticators.LoginPasswordAuthenticator',)) |
|
178 |
AUTH_FRONTENDS = [ |
|
179 |
'authentic2_mfa_totp.authenticators.TOTPAuthenticator', |
|
180 |
] |
|
181 |
AUTH_FRONTENDS.extend(plugins.register_plugins_authenticators(( |
|
182 |
'authentic2.authenticators.LoginPasswordAuthenticator', |
|
183 |
))) |
|
179 | 184 | |
180 | 185 |
########################### |
181 | 186 |
# RBAC settings |
src/authentic2/urls.py | ||
---|---|---|
119 | 119 |
url(r'^idp/', include('authentic2.idp.urls')), |
120 | 120 |
url(r'^manage/', include('authentic2.manager.urls')), |
121 | 121 |
url(r'^api/', include('authentic2.api_urls')), |
122 |
url(r'^totp/', include('authentic2_mfa_totp.urls')), |
|
122 | 123 |
] |
123 | 124 | |
124 | 125 |
try: |