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 a `KeycloakBuilder` to create a Keycloak client. To read Responses, you can use `CreatedResponseUtil` 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 and Description
    --- | ---
    `void` | `close()` Closes the underlying client.
    `static Keycloak` | `getInstance(String serverUrl, String realm, String clientId, String authToken)`
    `static Keycloak` | `getInstance(String serverUrl, String realm, String clientId, String authToken, SSLContext sllSslContext)`
    `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, SSLContext sslContext)`
    `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, org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider customJacksonProvider)`
    `static Keycloak` | `getInstance(String serverUrl, String realm, String username, String password, String clientId, String clientSecret, SSLContext sslContext, org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider customJacksonProvider, boolean disableTrustManager, String authToken)`
    `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()`
    `TokenManager` | `tokenManager()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static Keycloak getInstance(String serverUrl,
                                             String realm,
                                             String username,
                                             String password,
                                             String clientId,
                                             String clientSecret,
                                             SSLContext sslContext,
                                             org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider 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,
                                             org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider 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, this `Keycloak` instance cannot be reused.
      Specified by:
        `close` in interface `AutoCloseable`

    - #### isClosed

          public boolean isClosed()

      Returns:
        true if the underlying client is closed.

Copyright © 2021 JBoss by Red Hat. All rights reserved.