Class DefaultRedirectURICreationStrategy
- java.lang.Object
-
- net.shibboleth.idp.plugin.authn.duo.impl.DefaultRedirectURICreationStrategy
-
- All Implemented Interfaces:
BiFunction<javax.servlet.http.HttpServletRequest,DynamicDuoOIDCIntegration,String>
@ThreadSafe @Immutable public final class DefaultRedirectURICreationStrategy extends Object implements BiFunction<javax.servlet.http.HttpServletRequest,DynamicDuoOIDCIntegration,String>
Constructive, pure, function that returns a redirect_uri from one of (ordered):- A pre-registered redirect_uri on the Duo integration,
DynamicDuoOIDCIntegration.getRegisteredRedirectURI(). Or, if none are pre-registered; - Derived from the HTTP Servlet request server parameters, checking the origin against an allowed set of origins from the Duo integration - to prevent Host header injection.
Returns null if one can not be constructed.
Is thread-safe and immutable
-
-
Field Summary
Fields Modifier and Type Field Description private StringcallbackServletPathThe path, excluding the context and servlet paths, to the Duo callback handler.private org.slf4j.LoggerlogClass logger.
-
Constructor Summary
Constructors Constructor Description DefaultRedirectURICreationStrategy(String callbackPath)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringapply(javax.servlet.http.HttpServletRequest request, DynamicDuoOIDCIntegration integration)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.function.BiFunction
andThen
-
-
-
-
Constructor Detail
-
DefaultRedirectURICreationStrategy
public DefaultRedirectURICreationStrategy(@Nonnull @NotEmpty @ParameterName(name="callbackPath") String callbackPath)
Constructor.- Parameters:
callbackPath- the path segment relative to the servlet path of the callback endpoint.
-
-
Method Detail
-
apply
@Nullable public String apply(@Nonnull javax.servlet.http.HttpServletRequest request, @Nonnull DynamicDuoOIDCIntegration integration)
- Specified by:
applyin interfaceBiFunction<javax.servlet.http.HttpServletRequest,DynamicDuoOIDCIntegration,String>
-
-