Package org.keycloak.admin.client
Class KeycloakBuilder
java.lang.Object
org.keycloak.admin.client.KeycloakBuilder
Provides a
Keycloak client builder with the ability to customize the underlying
RESTEasy client used to communicate with the Keycloak server.
Example usage with a connection pool size of 20:
Keycloak keycloak = KeycloakBuilder.builder()
.serverUrl("https://sso.example.com/auth")
.realm("realm")
.username("user")
.password("pass")
.clientId("client")
.clientSecret("secret")
.resteasyClient(new ResteasyClientBuilder().connectionPoolSize(20).build())
.build();
Example usage with grant_type=client_credentials
Keycloak keycloak = KeycloakBuilder.builder()
.serverUrl("https://sso.example.com/auth")
.realm("example")
.grantType(OAuth2Constants.CLIENT_CREDENTIALS)
.clientId("client")
.clientSecret("secret")
.build();
- Author:
- Scott Rossillo
- See Also:
-
Client
-
Method Summary
Modifier and TypeMethodDescriptionauthorization(String auth) build()Builds a new Keycloak client from this builder.static KeycloakBuilderbuilder()Returns a new Keycloak builder.clientSecret(String clientSecret) resteasyClient(jakarta.ws.rs.client.Client resteasyClient)
-
Method Details
-
serverUrl
-
realm
-
grantType
-
username
-
password
-
clientId
-
scope
-
clientSecret
-
resteasyClient
-
authorization
-
build
Builds a new Keycloak client from this builder. -
builder
Returns a new Keycloak builder.
-