Profile configuration setting for custom redirect URI validation
Description
Environment
blocks
Activity
Henri Mikkonen October 21, 2024 at 4:24 PM
Henri Mikkonen June 5, 2024 at 11:55 AM
Included BiPredicate<URI,ProfileRequestContext> customRedirectUriValidationStrategy
to OIDCSSOProfileConfiguration. Implemented in AbstractOIDCSSOConfiguration and thus inherits by OIDC.SSO, OAuth2.Token and OAuth2.PAR profiles.
I’ll see how convenient utility beans I can get produced to OP and keep that ValidationContext idea in mind.
Henri Mikkonen June 3, 2024 at 2:15 PM
I think that this case is more complicated: the deployers shouldn’t ever use always true predicate.
I’m thinking of something like BiPredicate<URI,ProfileRequestContext>
where the URI is the already parsed redirection URI from the request.
I agree that PRC input is may be quite inconvenient, but I can try to “hide” it in the utility beans meant for this purpose. I feel that the metadata policy might fit those utility beans quite well: one could wire the JSON-policy to a bean that would be used for validating the URI against a list of static values or a regex for instance.
Scott Cantor June 3, 2024 at 1:38 PM
Notably we have the somewhat similar skipEndpointValidationWhenSigned option for SAML which just bypasses it. I don’t know if that’s warranted here or not (plus obviously a predicate hook is much more flexible anyway since an “always true” condition would be the equivalent to the skip option.
The major issue with a predicate like this is how to structure it for convenience. A PRC input like most of our conditions works but means a lot of digging into the tree to get information out if it’s needed for the condition.
I’ve not done it elsewhere but I wonder if creating some kind of “ValidationContext” under the PRC holding some of the basic inputs to the decision that would just get created and then removed around calling the condition might be a good idea.
The profile configuration settings for PAR, authorize and token profiles could contain a way to customise redirect URI validation logic. We identified need for it in https://shibboleth.atlassian.net/browse/JOIDC-178 .
The OP issue above was identified already before PAR was implemented. As the PAR spec mentions that “…the exact redirect URI matching MAY be relaxed when using PAR for confidential clients…”, it sounds justified that we offer a convenient way in profile configuration settings for customising the validation.