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

Force reauth when Loa2 is requested in AuthnContextClass #751

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/eduid/webapp/idp/assurance.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ def _gather_credentials(self, sso_session: SSOSession, ticket: LoginContext, use
_used_request = [x for x in _used_credentials.values() if x.source == UsedWhere.REQUEST]
logger.debug(f"Number of credentials used with this very request: {len(_used_request)}")

if ticket.reauthn_required:
req_authn_ctx = ticket.get_requested_authn_context()
if ticket.reauthn_required or req_authn_ctx is EduidAuthnContextClass.DIGG_LOA2:
logger.debug("Request requires authentication, not even considering credentials from the SSO session")
return list(_used_credentials.values())

Expand Down Expand Up @@ -214,7 +215,7 @@ def credentials(self) -> list[UsedCredential]:
return self._credentials


def response_authn(authn: AuthnState, ticket: LoginContext, user: IdPUser, sso_session: SSOSession) -> AuthnInfo:
def response_authn(authn: AuthnState, ticket: LoginContext, user: IdPUser) -> AuthnInfo:
"""
Figure out what AuthnContext to assert in a SAML response,
given the RequestedAuthnContext from the SAML request.
Expand Down
2 changes: 1 addition & 1 deletion src/eduid/webapp/idp/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def login_next_step(ticket: LoginContext, sso_session: SSOSession | None) -> Nex

try:
authn_state = AuthnState(user, sso_session, ticket)
authn_info = assurance.response_authn(authn_state, ticket, user, sso_session)
authn_info = assurance.response_authn(authn_state, ticket, user)
res = NextResult(message=IdPMsg.proceed, authn_info=authn_info, authn_state=authn_state)
except MissingPasswordFactor:
res = NextResult(message=IdPMsg.must_authenticate)
Expand Down
Loading