Skip to content

Refactor OpenidConnectAuthorizeForm to remove IalContext#10637

Merged
jmhooper merged 2 commits intomainfrom
jmhooper-refactor-authorize-form
May 16, 2024
Merged

Refactor OpenidConnectAuthorizeForm to remove IalContext#10637
jmhooper merged 2 commits intomainfrom
jmhooper-refactor-authorize-form

Conversation

@jmhooper
Copy link
Contributor

The OpenidConnectAuthorizeForm class is a form object that validates an OpenID Connect authorization request. This includes validating things like whether the scopes and ACR values requested by the service provider are allowed. For example, if an SP that is not allowed to request identity proofing requests scopes that required identity proofing this form responds with an error.

The IalContext class provides a number of helper methods helper methods for determining the IAL of a request by consuming either the integer IAL or the ACR values from the request and considering that along with SP defaults to determine a requests IAL. The IALContext can optionally consider the user context to make determinations about IAL2 requests. Since this is optional it leads to inconsistent results. For example, in the OpenidConnectAuthorizeForm the user context is not provided so the IALContext will never return true from ial2_or_greater? for an IALMax request even if the user has identity proofed. The IALContext is being replaced with the AuthnContextResolver to address this.

The OpenidConnectAuthorizeForm does not necessarily need to be concerned with the state of the user and rather needs to be concerned with what was requested in totality and whether it is allowed. This will be more important when we begin accepting multiple vectors of trust to support an IALMax-like feature for service providers using that feature.

This commit changes the OpenidConnectAuthorizeForm to remove the IALContext.

The `OpenidConnectAuthorizeForm` class is a form object that validates an OpenID Connect authorization request. This includes validating things like whether the scopes and ACR values requested by the service provider are allowed. For example, if an SP that is not allowed to request identity proofing requests scopes that required identity proofing this form responds with an error.

The `IalContext` class provides a number of helper methods helper methods for determining the IAL of a request by consuming either the integer IAL or the ACR values from the request and considering that along with SP defaults to determine a requests IAL. The `IALContext` can optionally consider the user context to make determinations about IAL2 requests. Since this is optional it leads to inconsistent results. For example, in the `OpenidConnectAuthorizeForm` the user context is not provided so the `IALContext` will never return true from `ial2_or_greater?` for an IALMax request even if the user has identity proofed. The `IALContext` is being replaced with the `AuthnContextResolver` to address this.

The `OpenidConnectAuthorizeForm` does not necessarily need to be concerned with the state of the user and rather needs to be concerned with what was requested in totality and whether it is allowed. This will be more important when we begin accepting multiple vectors of trust to support an IALMax-like feature for service providers using that feature.

This commit changes the `OpenidConnectAuthorizeForm` to remove the `IALContext`.

[skip changelog]
@jmhooper jmhooper requested review from a team and Sgtpluck May 16, 2024 14:59
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.

this feels really clear and easy to read to me. what an improvement, thank you 🎊

end
end

def identity_proofing_requested_or_default?
Copy link
Contributor

Choose a reason for hiding this comment

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

i LOVE all these little conditional methods, it makes things much clearer to me, thank you.

@jmhooper jmhooper merged commit 183a427 into main May 16, 2024
@jmhooper jmhooper deleted the jmhooper-refactor-authorize-form branch May 16, 2024 16:13
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.

2 participants