Class 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):
    1. A pre-registered redirect_uri on the Duo integration, DynamicDuoOIDCIntegration.getRegisteredRedirectURI(). Or, if none are pre-registered;
    2. 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 Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • callbackServletPath

        @Nonnull
        @NotEmpty
        private final String callbackServletPath
        The path, excluding the context and servlet paths, to the Duo callback handler.
    • 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.