Interface LoginContextFactory


  • public interface LoginContextFactory
    A factory for creating LoginContext instances.

    Instead of directly creating LoginContext this factory can be used. It takes care of locating the Configuration instance and switching of Thread's context classloader.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      javax.security.auth.login.LoginContext createLoginContext​(java.lang.String realm, javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler handler)
      Instantiate a new LoginContext object with a name, a Subject to be authenticated, and a CallbackHandler object.
    • Method Detail

      • createLoginContext

        javax.security.auth.login.LoginContext createLoginContext​(java.lang.String realm,
                                                                  javax.security.auth.Subject subject,
                                                                  javax.security.auth.callback.CallbackHandler handler)
                                                           throws javax.security.auth.login.LoginException
        Instantiate a new LoginContext object with a name, a Subject to be authenticated, and a CallbackHandler object.
        Parameters:
        realm - realm or application name
        subject - the Subject to authenticate.
        handler - the CallbackHandler object used by LoginModules to communicate with the user.
        Returns:
        created LoginContext
        Throws:
        javax.security.auth.login.LoginException - if the caller-specified name does not appear in the Configuration and there is no Configuration entry for "other", or if the caller-specified subject is null, or if the caller-specified callbackHandler is null.