public AuthContext getAuthContext(Credentials credentials, Subject subject,
Session session,
PrincipalProviderRegistry principalProviderRegistry,
String adminId, String anonymousId) throws RepositoryException {
CallbackHandler cbHandler = new CallbackHandlerImpl(credentials, session, principalProviderRegistry, adminId, anonymousId);
if (isLocal()){
return new JahiaLocalAuthContext(configuration, cbHandler, subject);
} else if (isJAAS()) {
return new JahiaJAASAuthContext(applicationName, cbHandler, subject);