private AuthContext getJAASAuthContext(Credentials creds, String appName) { CallbackHandler ch = new CallbackHandlerImpl(creds, securitySession, new ProviderRegistryImpl(new FallbackPrincipalProvider()), "admin", "anonymous"); return new JAASAuthContext(appName, ch, null); }
public void testMultipleModules() throws Exception { CallbackHandler ch = new CallbackHandlerImpl(new SimpleCredentials("user", "pass".toCharArray()), superuser, new ProviderRegistryImpl(new FallbackPrincipalProvider()), "admin", "anonymous"); LoginContext context = new LoginContext( APP_NAME, new Subject(), ch, new TestConfiguration()); context.login(); assertFalse("no principal set", context.getSubject().getPrincipals().isEmpty()); }
private AuthContext getAuthContext(Credentials creds, String config) throws RepositoryException { CallbackHandler ch = new CallbackHandlerImpl(creds, securitySession, new ProviderRegistryImpl(new FallbackPrincipalProvider()), "admin", "anonymous"); return new LocalAuthContext(getLoginModuleConfig(config), ch, null); }