Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use user setting to determine if the IdP should force use of mfa when available #653

Merged
merged 14 commits into from
Aug 12, 2024
Merged
4 changes: 4 additions & 0 deletions src/eduid/webapp/idp/mfa_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def need_security_key(user: IdPUser, ticket: LoginContext) -> bool:
logger.debug("User has no FIDO credentials, no extra requirement for MFA this session imposed")
return False

if user.preferences.always_use_security_key is False:
logger.debug("User has not forced MFA, no extra requirement for MFA this session imposed")
return False

for cred_key in ticket.pending_request.credentials_used:
credential: Optional[Credential]
if cred_key in ticket.pending_request.onetime_credentials:
Expand Down
Loading
Loading