org.keycloak.services.resources.admin

## Class ClientsResource

- java.lang.Object
- - org.keycloak.services.resources.admin.ClientsResource

-     public class ClientsResource
      extends Object

  Base resource class for managing a realm's clients.
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.jboss.logging.Logger` | `logger`
    `protected RealmModel` | `realm`
    `protected KeycloakSession` | `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientsResource(RealmModel realm, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.ws.rs.core.Response` | `createClient(ClientRepresentation rep)` Create a new client Client's client_id must be unique!
    `ClientResource` | `getClient(String id)` Base path for managing a specific client.
    `Stream<ClientRepresentation>` | `getClients(String clientId, boolean viewableOnly, boolean search, String searchQuery, Integer firstResult, Integer maxResults)` Get clients belonging to the realm Returns a list of clients belonging to the realm

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

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

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### realm

          protected RealmModel realm

    - #### session

          @Context
          protected KeycloakSession session

  - ### Constructor Detail

    - #### ClientsResource

          public ClientsResource(RealmModel realm,
                                 AdminPermissionEvaluator auth,
                                 AdminEventBuilder adminEvent)

  - ### Method Detail

    - #### getClients

          @GET
           @Produces(value="application/json")
          public Stream<ClientRepresentation> getClients(@QueryParam(value="clientId")
                                                                                                   String clientId,
                                                                                                   @QueryParam(value="viewableOnly") @DefaultValue(value="false")
                                                                                                   boolean viewableOnly,
                                                                                                   @QueryParam(value="search") @DefaultValue(value="false")
                                                                                                   boolean search,
                                                                                                   @QueryParam(value="q")
                                                                                                   String searchQuery,
                                                                                                   @QueryParam(value="first")
                                                                                                   Integer firstResult,
                                                                                                   @QueryParam(value="max")
                                                                                                   Integer maxResults)

      Get clients belonging to the realm Returns a list of clients belonging to the realm
      Parameters:
        `clientId` - filter by clientId
        `viewableOnly` - filter clients that cannot be viewed in full by admin
        `search` - whether this is a search query or a getClientById query
        `firstResult` - the first result
        `maxResults` - the max results to return

    - #### createClient

          @POST
           @Consumes(value="application/json")
          public javax.ws.rs.core.Response createClient(ClientRepresentation rep)

      Create a new client Client's client_id must be unique!
      Parameters:
        `rep` -
      Returns:

    - #### getClient

          @Path(value="{id}")
          public ClientResource getClient(@PathParam(value="id")
                                                              String id)

      Base path for managing a specific client.
      Parameters:
        `id` - id of client (not client-id)
      Returns:

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