use of com.bakdata.conquery.models.auth.apitoken.TokenStorage in project conquery by bakdata.
the class ApiTokenRealmFactory method createRealm.
@Override
public ConqueryAuthenticationRealm createRealm(ManagerNode managerNode) {
final TokenStorage tokenStorage = new TokenStorage(storeDir, apiTokenStoreConfig, managerNode.getValidator(), Jackson.BINARY_MAPPER.copy());
managerNode.getEnvironment().lifecycle().manage(tokenStorage);
final ApiTokenRealm apiTokenRealm = new ApiTokenRealm(managerNode.getStorage(), tokenStorage);
managerNode.getAuthController().getAuthenticationFilter().registerTokenExtractor(new ApiTokenExtractor());
JerseyEnvironment environment = managerNode.getEnvironment().jersey();
environment.register(new AbstractBinder() {
@Override
protected void configure() {
bind(apiTokenRealm).to(ApiTokenRealm.class);
}
});
environment.register(ApiTokenResource.class);
return apiTokenRealm;
}
Aggregations