Skip to content

Instantly share code, notes, and snippets.

@dasniko dasniko/example.java
Created Nov 27, 2017

Embed
What would you like to do?
Create AuthzClient with Spring Boot Adapter
@Bean
public AuthzClient authzClient(KeycloakSpringBootProperties kcProperties) {
Configuration configuration = new Configuration(
kcProperties.getAuthServerUrl(), kcProperties.getRealm(),
kcProperties.getResource(), kcProperties.getCredentials(), null);
return AuthzClient.create(configuration);
}
@musabqamri123

This comment has been minimized.

Copy link

musabqamri123 commented Feb 12, 2019

You can use the authzclient created by adapter..
CMKcConfigResolver cmKcConfigResolver = (CMKcConfigResolver)configResolver;
KeycloakDeployment deployment = cmKcConfigResolver.getDeployment();
this.authzClient = deployment.getPolicyEnforcer().getClient();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.