Class DefaultServerAuthContext

  • All Implemented Interfaces:
    jakarta.security.auth.message.config.ServerAuthContext, jakarta.security.auth.message.ServerAuth

    public class DefaultServerAuthContext
    extends Object
    implements jakarta.security.auth.message.config.ServerAuthContext
    The Server Authentication Context is an extra (required) indirection between the Application Server and the actual Server Authentication Module (SAM). This can be used to encapsulate any number of SAMs and either select one at run-time, invoke them all in order, etc.

    Since this simple example only has a single SAM, we delegate directly to that one. Note that this ServerAuthContext and the ServerAuthModule (SAM) share a common base interface: ServerAuth.

    Author:
    Arjan Tijms
    • Constructor Detail

      • DefaultServerAuthContext

        public DefaultServerAuthContext​(CallbackHandler handler,
                                        jakarta.security.auth.message.module.ServerAuthModule sam)
                                 throws jakarta.security.auth.message.AuthException
        Throws:
        jakarta.security.auth.message.AuthException
    • Method Detail

      • validateRequest

        public jakarta.security.auth.message.AuthStatus validateRequest​(jakarta.security.auth.message.MessageInfo messageInfo,
                                                                        Subject clientSubject,
                                                                        Subject serviceSubject)
                                                                 throws jakarta.security.auth.message.AuthException
        Specified by:
        validateRequest in interface jakarta.security.auth.message.ServerAuth
        Throws:
        jakarta.security.auth.message.AuthException
      • secureResponse

        public jakarta.security.auth.message.AuthStatus secureResponse​(jakarta.security.auth.message.MessageInfo messageInfo,
                                                                       Subject serviceSubject)
                                                                throws jakarta.security.auth.message.AuthException
        Specified by:
        secureResponse in interface jakarta.security.auth.message.ServerAuth
        Throws:
        jakarta.security.auth.message.AuthException
      • cleanSubject

        public void cleanSubject​(jakarta.security.auth.message.MessageInfo messageInfo,
                                 Subject subject)
                          throws jakarta.security.auth.message.AuthException
        Specified by:
        cleanSubject in interface jakarta.security.auth.message.ServerAuth
        Throws:
        jakarta.security.auth.message.AuthException