Package org.keycloak.admin.client
Class Keycloak
- java.lang.Object
-
- org.keycloak.admin.client.Keycloak
-
- All Implemented Interfaces:
AutoCloseable
public class Keycloak extends Object implements AutoCloseable
Provides a Keycloak client. By default, this implementation uses a the default RestEasy client builder settings. To customize the underling client, use aKeycloakBuilder
to create a Keycloak client. To read Responses, you can useCreatedResponseUtil
for objects created- Author:
- rodrigo.sasaki@icarros.com.br
- See Also:
KeycloakBuilder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the underlying client.static ResteasyClientProvider
getClientProvider()
static Keycloak
getInstance(String serverUrl, String realm, String clientId, String authToken)
static Keycloak
getInstance(String serverUrl, String realm, String username, String password, String clientId)
static Keycloak
getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret)
static Keycloak
getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext)
static Keycloak
getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext, Object customJacksonProvider)
static Keycloak
getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext, Object customJacksonProvider, boolean disableTrustManager, String authToken)
static Keycloak
getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext, Object customJacksonProvider, boolean disableTrustManager, String authToken, String scope)
static Keycloak
getInstance(String serverUrl, String realm, String username, String password, String clientId, SSLContext sslContext)
static Keycloak
getInstance(String serverUrl, String realm, String clientId, String authToken, SSLContext sllSslContext)
boolean
isClosed()
<T> T
proxy(Class<T> proxyClass, URI absoluteURI)
Create a secure proxy based on an absolute URI.RealmResource
realm(String realmName)
RealmsResource
realms()
ServerInfoResource
serverInfo()
static void
setClientProvider(ResteasyClientProvider provider)
TokenManager
tokenManager()
-
-
-
Method Detail
-
setClientProvider
public static void setClientProvider(ResteasyClientProvider provider)
-
getClientProvider
public static ResteasyClientProvider getClientProvider()
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext, Object customJacksonProvider, boolean disableTrustManager, String authToken, String scope)
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext, Object customJacksonProvider, boolean disableTrustManager, String authToken)
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret)
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext)
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext, Object customJacksonProvider)
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String username, String password, String clientId)
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String username, String password, String clientId, SSLContext sslContext)
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String clientId, String authToken)
-
getInstance
public static Keycloak getInstance(String serverUrl, String realm, String clientId, String authToken, SSLContext sllSslContext)
-
realms
public RealmsResource realms()
-
realm
public RealmResource realm(String realmName)
-
serverInfo
public ServerInfoResource serverInfo()
-
tokenManager
public TokenManager tokenManager()
-
proxy
public <T> T proxy(Class<T> proxyClass, URI absoluteURI)
Create a secure proxy based on an absolute URI. All set up with appropriate token- Type Parameters:
T
-- Parameters:
proxyClass
-absoluteURI
-- Returns:
-
close
public void close()
Closes the underlying client. After calling this method, thisKeycloak
instance cannot be reused.- Specified by:
close
in interfaceAutoCloseable
-
isClosed
public boolean isClosed()
- Returns:
- true if the underlying client is closed.
-
-