Class ValidateUserAgentAddress

    • Field Detail

      • log

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

        @Nullable
        private UserAgentContext uaContext
        User Agent context containing address to evaluate.
      • principalName

        @Nullable
        private String principalName
        The principal name established by the action, if any.
    • Constructor Detail

      • ValidateUserAgentAddress

        public ValidateUserAgentAddress()
        Constructor.
    • Method Detail

      • setMappings

        public void setMappings​(@Nullable @NonnullElements
                                Map<String,​Collection<IPRange>> newMappings)
        Set the IP range(s) to authenticate as particular principals.
        Parameters:
        newMappings - the IP range(s) to authenticate as particular principals
      • doPreExecute

        protected boolean doPreExecute​(@Nonnull
                                       ProfileRequestContext profileRequestContext,
                                       @Nonnull
                                       AuthenticationContext authenticationContext)
        Performs this authentication action's pre-execute step. Default implementation just returns true.
        Overrides:
        doPreExecute in class AbstractValidationAction
        Parameters:
        profileRequestContext - the current IdP profile request context
        authenticationContext - the current authentication context
        Returns:
        true iff execution should continue
      • doExecute

        protected void doExecute​(@Nonnull
                                 ProfileRequestContext profileRequestContext,
                                 @Nonnull
                                 AuthenticationContext authenticationContext)
        Performs this authentication action. Default implementation throws an exception.
        Overrides:
        doExecute in class AbstractAuthenticationAction
        Parameters:
        profileRequestContext - the current IdP profile request context
        authenticationContext - the current authentication context
      • isAuthenticated

        private boolean isAuthenticated​(@Nonnull
                                        InetAddress address,
                                        @Nonnull @NonnullElements
                                        Collection<IPRange> ranges)
        Checks whether the given IP address meets a set of IP range requirements.
        Parameters:
        address - the IP address to check
        ranges - the ranges to check
        Returns:
        true if the given IP address meets this stage's IP range requirements, false otherwise
      • populateSubject

        @Nonnull
        protected Subject populateSubject​(@Nonnull
                                          Subject subject)
        Subclasses must override this method to complete the population of the Subject with Principal and credential information based on the validation they perform.

        Typically this will include attaching a UsernamePrincipal, but this is not a requirement if other components are suitably overridden.

        Specified by:
        populateSubject in class AbstractValidationAction
        Parameters:
        subject - subject to populate
        Returns:
        the input subject