use of org.keycloak.adapters.authorization.ClaimInformationPointProviderFactory in project keycloak by keycloak.
the class ClaimInformationPointProviderTest method getClaimInformationProviderForPath.
private ClaimInformationPointProvider getClaimInformationProviderForPath(String path, String providerName) {
KeycloakDeployment deployment = KeycloakDeploymentBuilder.build(getClass().getResourceAsStream("/authorization-test/enforcer-config-claims-provider.json"));
deployment.setClient(HttpClients.createDefault());
PolicyEnforcer policyEnforcer = deployment.getPolicyEnforcer();
Map<String, ClaimInformationPointProviderFactory> providers = policyEnforcer.getClaimInformationPointProviderFactories();
PathConfig pathConfig = policyEnforcer.getPaths().get(path);
assertNotNull(pathConfig);
Map<String, Map<String, Object>> cipConfig = pathConfig.getClaimInformationPointConfig();
assertNotNull(cipConfig);
ClaimInformationPointProviderFactory factory = providers.get(providerName);
assertNotNull(factory);
Map<String, Object> claimsConfig = cipConfig.get(providerName);
return factory.create(claimsConfig);
}
Aggregations