public class ClientResource extends Object
Modifier and Type | Field and Description |
---|---|
protected ClientModel |
client |
protected KeycloakApplication |
keycloak |
protected static ServicesLogger |
logger |
protected RealmModel |
realm |
protected KeycloakSession |
session |
protected javax.ws.rs.core.UriInfo |
uriInfo |
Constructor and Description |
---|
ClientResource(RealmModel realm,
RealmAuth auth,
ClientModel clientModel,
KeycloakSession session,
AdminEventBuilder adminEvent) |
Modifier and Type | Method and Description |
---|---|
AuthorizationService |
authorization() |
void |
deleteClient()
Delete the client
|
Map<String,Long> |
getApplicationSessionCount()
Get application session count
Returns a number of user sessions associated with this client
{
"count": number
}
|
ClientAttributeCertificateResource |
getCertficateResource(String attributePrefix)
Get representation of certificate resource
|
ClientRepresentation |
getClient()
Get representation of the client
|
CredentialRepresentation |
getClientSecret()
Get the client secret
|
javax.ws.rs.core.Response |
getInstallationProvider(String providerId) |
protected KeycloakApplication |
getKeycloakApplication() |
Map<String,Long> |
getOfflineSessionCount()
Get application offline session count
Returns a number of offline user sessions associated with this client
{
"count": number
}
|
List<UserSessionRepresentation> |
getOfflineUserSessions(Integer firstResult,
Integer maxResults)
Get offline sessions for client
Returns a list of offline user sessions associated with this client
|
ProtocolMappersResource |
getProtocolMappers() |
RoleContainerResource |
getRoleContainerResource() |
ScopeMappedResource |
getScopeMappedResource()
Base path for managing the scope mappings for the client
|
UserRepresentation |
getServiceAccountUser()
Get a user dedicated to the service account
|
List<UserSessionRepresentation> |
getUserSessions(Integer firstResult,
Integer maxResults)
Get user sessions for client
Returns a list of user sessions associated with this client
|
GlobalRequestResult |
pushRevocation()
Push the client's revocation policy to its admin URL
If the client has an admin URL, push revocation policy to it.
|
ClientRepresentation |
regenerateRegistrationAccessToken()
Generate a new registration access token for the client
|
CredentialRepresentation |
regenerateSecret()
Generate a new secret for the client
|
void |
registerNode(Map<String,String> formParams)
Register a cluster node with the client
Manually register cluster node to this client - usually it's not needed to call this directly as adapter should handle
by sending registration request to Keycloak
|
GlobalRequestResult |
testNodesAvailable()
Test if registered cluster nodes are available
Tests availability by sending 'ping' request to all cluster nodes.
|
void |
unregisterNode(String node)
Unregister a cluster node from the client
|
javax.ws.rs.core.Response |
update(ClientRepresentation rep)
Update the client
|
void |
updateClientFromRep(ClientRepresentation rep,
ClientModel client,
KeycloakSession session) |
protected static final ServicesLogger logger
protected RealmModel realm
protected ClientModel client
protected KeycloakSession session
@Context protected javax.ws.rs.core.UriInfo uriInfo
@Context protected KeycloakApplication keycloak
public ClientResource(RealmModel realm, RealmAuth auth, ClientModel clientModel, KeycloakSession session, AdminEventBuilder adminEvent)
protected KeycloakApplication getKeycloakApplication()
@Path(value="protocol-mappers") public ProtocolMappersResource getProtocolMappers()
@PUT @Consumes(value="application/json") public javax.ws.rs.core.Response update(ClientRepresentation rep)
rep
- public void updateClientFromRep(ClientRepresentation rep, ClientModel client, KeycloakSession session) throws ModelDuplicateException
ModelDuplicateException
@GET @Produces(value="application/json") public ClientRepresentation getClient()
@Path(value="certificates/{attr}") public ClientAttributeCertificateResource getCertficateResource(@PathParam(value="attr") String attributePrefix)
attributePrefix
- @GET @Path(value="installation/providers/{providerId}") public javax.ws.rs.core.Response getInstallationProvider(@PathParam(value="providerId") String providerId)
@DELETE public void deleteClient()
@Path(value="client-secret") @POST @Produces(value="application/json") @Consumes(value="application/json") public CredentialRepresentation regenerateSecret()
@Path(value="registration-access-token") @POST @Produces(value="application/json") @Consumes(value="application/json") public ClientRepresentation regenerateRegistrationAccessToken()
@Path(value="client-secret") @GET @Produces(value="application/json") public CredentialRepresentation getClientSecret()
@Path(value="scope-mappings") public ScopeMappedResource getScopeMappedResource()
@Path(value="roles") public RoleContainerResource getRoleContainerResource()
@Path(value="service-account-user") @GET @Produces(value="application/json") public UserRepresentation getServiceAccountUser()
@Path(value="push-revocation") @POST @Produces(value="application/json") public GlobalRequestResult pushRevocation()
@Path(value="session-count") @GET @Produces(value="application/json") public Map<String,Long> getApplicationSessionCount()
@Path(value="user-sessions") @GET @Produces(value="application/json") public List<UserSessionRepresentation> getUserSessions(@QueryParam(value="first") Integer firstResult, @QueryParam(value="max") Integer maxResults)
firstResult
- Paging offsetmaxResults
- Paging size@Path(value="offline-session-count") @GET @Produces(value="application/json") public Map<String,Long> getOfflineSessionCount()
@Path(value="offline-sessions") @GET @Produces(value="application/json") public List<UserSessionRepresentation> getOfflineUserSessions(@QueryParam(value="first") Integer firstResult, @QueryParam(value="max") Integer maxResults)
firstResult
- Paging offsetmaxResults
- Paging size@Path(value="nodes") @POST @Consumes(value="application/json") public void registerNode(Map<String,String> formParams)
formParams
- @Path(value="nodes/{node}") @DELETE public void unregisterNode(@PathParam(value="node") String node)
node
- @Path(value="test-nodes-available") @GET @Produces(value="application/json") public GlobalRequestResult testNodesAvailable()
@Path(value="/authz") public AuthorizationService authorization()
Copyright © 2016 JBoss by Red Hat. All rights reserved.