Skip to content

Recognize SAML IALMax using authn context comparison in SAML protocol#10095

Merged
jmhooper merged 2 commits intomainfrom
jmhooper-add-authn-context-comparison-recognition-to-saml-protocol
Feb 21, 2024
Merged

Recognize SAML IALMax using authn context comparison in SAML protocol#10095
jmhooper merged 2 commits intomainfrom
jmhooper-add-authn-context-comparison-recognition-to-saml-protocol

Conversation

@jmhooper
Copy link
Contributor

@jmhooper jmhooper commented Feb 15, 2024

SAML SPs can request IALMax by using an IAL authn context that does not require proofing and including a Authn Context Comparison value of "minimum". This essentially says that the "IAL1" Authn context is the minimum acceptable context so "IAL2" is also acceptable.

This is problematic for the new AuthnContextResolver since it does not have visibility into these attributes on the SAML request when resolving the authn context.

This commit addresses the issue by returning the IALMax Authentication Context Reference from Saml#ial in this case. This way the IALMax value is picked up downstream by the AuthnContextResolver.

This type of request has a few differences from an IALMax request with the IALMax authn context reference:

  • If a service provider that cannot make IAL2 requests makes an IAL1 request in this way it will always be serviced without proofed attributes. An IALMax request with the IALMax authn context reference for a service provider that cannot make IAL2 requests results in an error.
  • If a service provider is not on the list of SPs that can make an IALMax request but requests IALMax in this way it will be allowed. I am not sure if this is intended but it is the behavior prior to this commit so it is not a regression.

@jmhooper jmhooper force-pushed the jmhooper-add-authn-context-comparison-recognition-to-saml-protocol branch from ff5416f to c2e78d8 Compare February 16, 2024 15:21
SAML SPs can request IALMax by using an IAL authn context that does not require proofing and including a Authn Context Comparison value of "minimum". This essentially says that the "IAL1" Authn context is the minimum acceptable context so "IAL2" is also acceptable.

This is problematic for the new `AuthnContextResolver` since it does not have visibility into these attributes on the SAML request when resolving the authn context.

This commit addresses the issue by returning the IALMax Authentication Context Reference from the `Saml#ial` in this case. This way it is picked up downstream by the `AuthnContextResolver`.

[skip changelog]
@jmhooper jmhooper force-pushed the jmhooper-add-authn-context-comparison-recognition-to-saml-protocol branch from 27cf0cc to 1b4dea1 Compare February 20, 2024 17:35
@jmhooper jmhooper requested review from a team, Sgtpluck and zachmargolis February 20, 2024 17:35
@jmhooper jmhooper marked this pull request as ready for review February 20, 2024 17:37
Comment on lines 150 to +151
@ial_context ||= IalContext.new(
ial: requested_ial_authn_context,
ial: resolved_authn_context_int_ial,
Copy link
Contributor

@zachmargolis zachmargolis Feb 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT of renaming the attribute in the IalContext constructor to be int_ial for clarity?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IalContext actually takes an integer or a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am making sure that we pass the integer value here because that will properly compute IALMax. In some IALMax cases the value is the string value for IAL1 with the minimum context comparison.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it!

Copy link
Contributor

@Sgtpluck Sgtpluck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small, non-blocking suggestion. Thanks for plumbing this through.


def pii_requested_but_locked?
if (sp_session && sp_session_ial > 1) || ial_context.ialmax_requested?
if resolved_authn_context_result.identity_proofing? || resolved_authn_context_result.ialmax?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[question] since both parts of this conditional are now on the resolved_authn_context_result object, does it make sense to have a method in that object that's like resolved_authn_context_result.pii_requested?

Copy link
Contributor Author

@jmhooper jmhooper Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hesitate a little because pii_requested sounds like we are doing proofing if you don't have the context about ialmax (which is not hidden pretty deep in the Vot::Parser. We could always add something like identity_proofing_or_ialmax??

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i think that sounds good!

@jmhooper jmhooper merged commit 206875d into main Feb 21, 2024
@jmhooper jmhooper deleted the jmhooper-add-authn-context-comparison-recognition-to-saml-protocol branch February 21, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants