Class SimpleServerAuthConfig

    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleServerAuthConfig​(java.lang.String layer, java.lang.String appContext, javax.security.auth.callback.CallbackHandler handler, java.util.Map<java.lang.String,​java.lang.Object> properties)
      Creates a new SimpleServerAuthConfig.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected ServerAuthContext createServerAuthContext​(java.util.List<ServerAuthModule> modules)
      Creates the ServerAuthContext.
      java.lang.String getAppContext()
      Returns the application context for which this configuration applies.
      ServerAuthContext getAuthContext​(java.lang.String authContextID, javax.security.auth.Subject serviceSubject, java.util.Map<java.lang.String,​java.lang.Object> properties)
      Returns the ServerAuthContext for the given authentication context ID.
      java.lang.String getAuthContextID​(MessageInfo messageInfo)
      Determines the authentication context ID for the given message.
      java.lang.String getMessageLayer()
      Returns the message layer for which this configuration applies.
      boolean isProtected()
      Indicates whether the authentication mechanism is protected, meaning that the configuration data is stored securely.
      void refresh()
      Refreshes the configuration, reloading any changed settings.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleServerAuthConfig

        public SimpleServerAuthConfig​(java.lang.String layer,
                                      java.lang.String appContext,
                                      javax.security.auth.callback.CallbackHandler handler,
                                      java.util.Map<java.lang.String,​java.lang.Object> properties)
        Creates a new SimpleServerAuthConfig.
        Parameters:
        layer - Message layer
        appContext - Application context
        handler - Callback handler
        properties - Configuration properties
    • Method Detail

      • getAuthContextID

        public java.lang.String getAuthContextID​(MessageInfo messageInfo)
        Determines the authentication context ID for the given message.

        Returns the MessageInfo's string representation as the auth context ID.

        Specified by:
        getAuthContextID in interface AuthConfig
        Parameters:
        messageInfo - the message information used to determine the context ID
        Returns:
        the authentication context ID, or null if no context applies
      • refresh

        public void refresh()
        Refreshes the configuration, reloading any changed settings.

        Clears the cached ServerAuthConfig so it will be recreated on next use.

        Specified by:
        refresh in interface AuthConfig
      • isProtected

        public boolean isProtected()
        Indicates whether the authentication mechanism is protected, meaning that the configuration data is stored securely.

        This implementation always returns false.

        Specified by:
        isProtected in interface AuthConfig
        Returns:
        true if the mechanism is protected, false otherwise
      • getAuthContext

        public ServerAuthContext getAuthContext​(java.lang.String authContextID,
                                                javax.security.auth.Subject serviceSubject,
                                                java.util.Map<java.lang.String,​java.lang.Object> properties)
                                         throws AuthException
        Returns the ServerAuthContext for the given authentication context ID.

        Loads ServerAuthModule instances from properties keyed with org.apache.catalina.authenticator.jaspic.ServerAuthModule.N where N is 1-based index. The returned context is cached and reused for subsequent calls.

        Specified by:
        getAuthContext in interface ServerAuthConfig
        Parameters:
        authContextID - the authentication context identifier
        serviceSubject - the service subject
        properties - the configuration properties
        Returns:
        the server authentication context
        Throws:
        AuthException - if an error occurs during authentication context creation
      • createServerAuthContext

        protected ServerAuthContext createServerAuthContext​(java.util.List<ServerAuthModule> modules)
        Creates the ServerAuthContext. Can be overridden by subclasses to provide a custom implementation.
        Parameters:
        modules - List of ServerAuthModule instances
        Returns:
        The ServerAuthContext instance