use of com.bakdata.conquery.models.config.auth.AuthenticationRealmFactory in project conquery by bakdata.
the class AuthorizationController method externalInit.
public void externalInit(ManagerNode manager, List<AuthenticationRealmFactory> authenticationRealmFactories) {
manager.getAdmin().getJerseyConfig().register(authenticationFilter);
manager.getEnvironment().jersey().register(authenticationFilter);
// Init authentication realms provided by the config.
for (AuthenticationRealmFactory authenticationConf : authenticationRealmFactories) {
ConqueryAuthenticationRealm realm = authenticationConf.createRealm(manager);
authenticationRealms.add(realm);
realms.add(realm);
}
// Register all realms in Shiro
log.info("Registering the following realms to Shiro:\n\t{}", realms.stream().map(Realm::getName).collect(Collectors.joining("\n\t")));
securityManager.setRealms(realms);
}
use of com.bakdata.conquery.models.config.auth.AuthenticationRealmFactory in project conquery by bakdata.
the class ApiTokenRealmTest method overrideConfig.
@Override
public ConqueryConfig overrideConfig(ConqueryConfig conf, final File workDir) {
XodusStoreFactory storageConfig = (XodusStoreFactory) conf.getStorage();
final Path storageDir = workDir.toPath().resolve(storageConfig.getDirectory().resolve(getClass().getSimpleName()));
return conf.withStorage(storageConfig.withDirectory(storageDir)).withAuthenticationRealms(ImmutableList.<AuthenticationRealmFactory>builder().addAll(conf.getAuthenticationRealms()).add(new ApiTokenRealmFactory(storageDir, new XodusConfig())).build());
}
Aggregations