public class ClientResource extends Object
Modifier and Type | Field and Description |
---|---|
protected ClientModel |
client |
protected org.keycloak.common.ClientConnection |
clientConnection |
protected KeycloakApplication |
keycloak |
protected static org.jboss.logging.Logger |
logger |
protected RealmModel |
realm |
protected KeycloakSession |
session |
Constructor and Description |
---|
ClientResource(RealmModel realm,
AdminPermissionEvaluator auth,
ClientModel clientModel,
KeycloakSession session,
AdminEventBuilder adminEvent) |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultClientScope(String clientScopeId) |
void |
addOptionalClientScope(String clientScopeId) |
AuthorizationService |
authorization() |
ClientScopeEvaluateResource |
clientScopeEvaluateResource() |
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
|
List<ClientScopeRepresentation> |
getDefaultClientScopes()
Get default client scopes.
|
javax.ws.rs.core.Response |
getInstallationProvider(String providerId) |
protected KeycloakApplication |
getKeycloakApplication() |
ManagementPermissionReference |
getManagementPermissions()
Return object stating whether client Authorization permissions have been initialized or not and a reference
|
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
|
List<ClientScopeRepresentation> |
getOptionalClientScopes()
Get optional client scopes.
|
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
|
void |
removeDefaultClientScope(String clientScopeId) |
void |
removeOptionalClientScope(String clientScopeId) |
ManagementPermissionReference |
setManagementPermissionsEnabled(ManagementPermissionReference ref)
Return object stating whether client Authorization permissions have been initialized or not and a reference
|
GlobalRequestResult |
testNodesAvailable()
Test if registered cluster nodes are available
Tests availability by sending 'ping' request to all cluster nodes.
|
static ManagementPermissionReference |
toMgmtRef(ClientModel client,
AdminPermissionManagement permissions) |
void |
unregisterNode(String node)
Unregister a cluster node from the client
|
javax.ws.rs.core.Response |
update(ClientRepresentation rep)
Update the client
|
protected static final org.jboss.logging.Logger logger
protected RealmModel realm
protected ClientModel client
protected KeycloakSession session
@Context protected KeycloakApplication keycloak
@Context protected org.keycloak.common.ClientConnection clientConnection
public ClientResource(RealmModel realm, AdminPermissionEvaluator 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
- @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()
@GET @Produces(value="application/json") @Path(value="default-client-scopes") public List<ClientScopeRepresentation> getDefaultClientScopes()
@PUT @Path(value="default-client-scopes/{clientScopeId}") public void addDefaultClientScope(@PathParam(value="clientScopeId") String clientScopeId)
@DELETE @Path(value="default-client-scopes/{clientScopeId}") public void removeDefaultClientScope(@PathParam(value="clientScopeId") String clientScopeId)
@GET @Produces(value="application/json") @Path(value="optional-client-scopes") public List<ClientScopeRepresentation> getOptionalClientScopes()
@PUT @Path(value="optional-client-scopes/{clientScopeId}") public void addOptionalClientScope(@PathParam(value="clientScopeId") String clientScopeId)
@DELETE @Path(value="optional-client-scopes/{clientScopeId}") public void removeOptionalClientScope(@PathParam(value="clientScopeId") String clientScopeId)
@Path(value="evaluate-scopes") public ClientScopeEvaluateResource clientScopeEvaluateResource()
@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
- Maximum results size (defaults to 100)@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
- Maximum results size (defaults to 100)@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()
@Path(value="management/permissions") @GET @Produces(value="application/json") public ManagementPermissionReference getManagementPermissions()
public static ManagementPermissionReference toMgmtRef(ClientModel client, AdminPermissionManagement permissions)
@Path(value="management/permissions") @PUT @Produces(value="application/json") @Consumes(value="application/json") public ManagementPermissionReference setManagementPermissionsEnabled(ManagementPermissionReference ref)
Copyright © 2019 JBoss by Red Hat. All rights reserved.