code: private static LoginContext createLoginContext(AuthType authType, Subject subject,
        ClassLoader classLoader, javax.security.auth.login.Configuration configuration,
        AlluxioConfiguration alluxioConf)
        throws LoginException {
      CallbackHandler callbackHandler = null;
      if (authType.equals(AuthType.SIMPLE) || authType.equals(AuthType.CUSTOM)) {
        callbackHandler = new AppLoginModule.AppCallbackHandler(alluxioConf);
      }
  
      ClassLoader previousClassLoader = Thread.currentThread().getContextClassLoader();
      Thread.currentThread().setContextClassLoader(classLoader);
      try {
        // Create LoginContext based on authType, corresponding LoginModule should be registered
        // under the authType name in LoginModuleConfiguration.
        return new LoginContext(authType.getAuthName(), subject, callbackHandler, configuration);
      } finally {
        Thread.currentThread().setContextClassLoader(previousClassLoader);
      }
    }
docs: Creates a new {@link LoginContext} with the correct class loader.
  
  @param authType the {@link AuthType} to use
  @param subject the {@link Subject} to use
  @param classLoader the {@link ClassLoader} to use
  @param configuration the {@link javax.security.auth.login.Configuration} to use
  @param alluxioConf Alluxio configuration
  @return the new {@link LoginContext} instance
  @throws LoginException if LoginContext cannot be created