mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 07:25:04 +02:00
Create anonymous TFA authenticator in ilias crawler
This ensures that *some* TFA authenticator is always present when authenticating, even if none is specified in the config. The TfaAuthenticator does not depend on any configured values, so it can be created on-demand.
This commit is contained in:
parent
0096a0c077
commit
486699cef3
1 changed files with 2 additions and 2 deletions
|
|
@ -7,7 +7,7 @@ import aiohttp
|
|||
from aiohttp import hdrs
|
||||
from bs4 import BeautifulSoup, Tag
|
||||
|
||||
from ...auth import Authenticator
|
||||
from ...auth import Authenticator, TfaAuthenticator
|
||||
from ...config import Config
|
||||
from ...logging import ProgressBar, log
|
||||
from ...output_dir import FileSink, Redownload
|
||||
|
|
@ -523,7 +523,7 @@ class KitShibbolethLogin:
|
|||
soup: BeautifulSoup
|
||||
) -> BeautifulSoup:
|
||||
if not self._tfa_auth:
|
||||
raise RuntimeError("No 'tfa_auth' present but you use two-factor authentication!")
|
||||
self._tfa_auth = TfaAuthenticator("ilias-anon-tfa")
|
||||
|
||||
tfa_token = await self._tfa_auth.password()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue