public class ClientResource extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ClientModel |
client |
protected KeycloakApplication |
keycloak |
protected static org.jboss.logging.Logger |
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 |
|---|---|
void |
deleteAllowedOrigins(Set<String> allowedOrigins)
Delete the specified origins from current allowed origins
This is used for CORS requests.
|
void |
deleteClient()
Delete the client
|
Set<String> |
getAllowedOrigins()
Get allowed origins
This is used for CORS requests.
|
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
|
String |
getInstallation()
Deprecated.
|
javax.ws.rs.core.Response |
getInstallationProvider(String providerId) |
String |
getJBossInstallation()
Deprecated.
|
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
|
void |
logout(String username)
Logout the user by username
If the client has an admin URL, invalidate the sessions for a particular user directly.
|
GlobalRequestResult |
logoutAll()
Logout all sessions
If the client has an admin URL, invalidate all sessions associated with that client directly.
|
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 |
updateAllowedOrigins(Set<String> allowedOrigins)
Update allowed origins
This is used for CORS requests.
|
static void |
updateClientFromRep(ClientRepresentation rep,
ClientModel client,
KeycloakSession session) |
protected static final org.jboss.logging.Logger 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()
public ProtocolMappersResource getProtocolMappers()
public javax.ws.rs.core.Response update(ClientRepresentation rep)
rep - public static void updateClientFromRep(ClientRepresentation rep, ClientModel client, KeycloakSession session) throws ModelDuplicateException
ModelDuplicateExceptionpublic ClientRepresentation getClient()
public ClientAttributeCertificateResource getCertficateResource(String attributePrefix)
attributePrefix - public javax.ws.rs.core.Response getInstallationProvider(String providerId)
@Deprecated public String getInstallation() throws IOException
IOException@Deprecated public String getJBossInstallation() throws IOException
IOExceptionpublic void deleteClient()
public CredentialRepresentation regenerateSecret()
public ClientRepresentation regenerateRegistrationAccessToken()
public CredentialRepresentation getClientSecret()
public ScopeMappedResource getScopeMappedResource()
public RoleContainerResource getRoleContainerResource()
public Set<String> getAllowedOrigins()
public void updateAllowedOrigins(Set<String> allowedOrigins)
allowedOrigins - public void deleteAllowedOrigins(Set<String> allowedOrigins)
allowedOrigins - List of origins to deletepublic UserRepresentation getServiceAccountUser()
public GlobalRequestResult pushRevocation()
public Map<String,Long> getApplicationSessionCount()
public List<UserSessionRepresentation> getUserSessions(Integer firstResult, Integer maxResults)
firstResult - Paging offsetmaxResults - Paging sizepublic Map<String,Long> getOfflineSessionCount()
public List<UserSessionRepresentation> getOfflineUserSessions(Integer firstResult, Integer maxResults)
firstResult - Paging offsetmaxResults - Paging sizepublic GlobalRequestResult logoutAll()
public void logout(String username)
public void registerNode(Map<String,String> formParams)
formParams - public void unregisterNode(String node)
node - public GlobalRequestResult testNodesAvailable()
Copyright © 2016 JBoss by Red Hat. All rights reserved.