Class AccessTokenValidator

    • Method Detail

      • getExtensionDescription

        public abstract java.lang.String[] getExtensionDescription()
        Retrieves a human-readable description for this extension. Each element of the array that is returned will be considered a separate paragraph in generated documentation.
        Specified by:
        getExtensionDescription in interface UnboundIDExtension
        Returns:
        A human-readable description for this extension, or null or an empty array if no description should be available.
      • getExamplesArgumentSets

        public java.util.Map<java.util.List<java.lang.String>,​java.lang.String> getExamplesArgumentSets()
        Retrieves a map containing examples of configurations that may be used for this extension. The map key should be a list of sample arguments, and the corresponding value should be a description of the behavior that will be exhibited by the extension when used with that configuration.
        Specified by:
        getExamplesArgumentSets in interface ExampleUsageProvider
        Returns:
        A map containing examples of configurations that may be used for this extension. It may be null or empty if there should not be any example argument sets.
      • defineConfigArguments

        public void defineConfigArguments​(ArgumentParser parser)
                                   throws ArgumentException
        Updates the provided argument parser to define any configuration arguments which may be used by this extension. The argument parser may also be updated to define relationships between arguments (e.g., to specify required, exclusive, or dependent argument sets).
        Specified by:
        defineConfigArguments in interface Configurable
        Parameters:
        parser - The argument parser to be updated with the configuration arguments which may be used by this extension.
        Throws:
        ArgumentException - If a problem is encountered while updating the provided argument parser.
      • initializeTokenValidator

        public void initializeTokenValidator​(ServerContext serverContext,
                                             AccessTokenValidatorConfig config,
                                             ArgumentParser parser)
                                      throws java.lang.Exception
        Initializes this access token validator.
        Parameters:
        serverContext - A handle to the server context for the server in which this extension is running.
        config - The general configuration for this token validator.
        parser - The argument parser which has been initialized from the configuration for this token validator.
        Throws:
        java.lang.Exception - If a problem occurs while initializing this token validator.
      • finalizeTokenValidator

        public void finalizeTokenValidator()
        Performs any cleanup which may be necessary when this token validator is to be taken out of service.
      • validate

        public abstract TokenValidationResult validate​(java.lang.String encodedAccessToken)
                                                throws java.lang.Exception
        Validate the provided access token.
        Parameters:
        encodedAccessToken - access token string as it is received from the requesting client.
        Returns:
        The PingAuthorize Server may be configured to accept access tokens from multiple sources so it is important that each validator differentiate between a token format that it does not recognize and a token that it can process but is not valid. If the token can be processed, the validator must return a TokenValidationResult object containing token properties. Most importantly the active field of the TokenValidationResult must be set by the validator. The decision as to whether an access token is accepted or not is made by the servlet hosting the token validator. If the token cannot be introspected by the Access Token Validator it must return null to allow other validators to have a chance to process the token.
        Throws:
        java.lang.Exception - if an error occurs during the processing of a token that can be introspected by the validator. Exceptions should only be thrown for unexpected internal errors. Sensitive information should not be included in the exception message as the message may be returned to the client application that has passed the token.