public class ApplicationResource extends Object
Modifier and Type | Field and Description |
---|---|
protected ApplicationModel |
application |
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 |
---|
ApplicationResource(RealmModel realm,
RealmAuth auth,
ApplicationModel applicationModel,
KeycloakSession session) |
Modifier and Type | Method and Description |
---|---|
void |
deleteAllowedOrigins(Set<String> allowedOrigins)
Remove set of allowed origins from current allowed origins list.
|
void |
deleteApplication()
Delete this application.
|
Set<String> |
getAllowedOrigins()
Returns set of allowed origin.
|
ApplicationRepresentation |
getApplication()
Get representation of the application.
|
Map<String,Integer> |
getApplicationSessionCount()
Number of user sessions associated with this application
{
"count": number
}
|
ClientAttributeCertificateResource |
getCertficateResource(String attributePrefix) |
CredentialRepresentation |
getClientSecret()
Get the secret of this application
|
String |
getInstallation()
Return keycloak.json file for this application to be used to configure the adapter of that application.
|
String |
getJBossInstallation()
Return XML that can be included in the JBoss/Wildfly Keycloak subsystem to configure the adapter of that application.
|
protected KeycloakApplication |
getKeycloakApplication() |
ProtocolMappersResource |
getProtocolMappers() |
RoleContainerResource |
getRoleContainerResource() |
ScopeMappedResource |
getScopeMappedResource()
Base path for managing the scope mappings for this application
|
List<UserSessionRepresentation> |
getUserSessions(Integer firstResult,
Integer maxResults)
Return a list of user sessions associated with this application
|
void |
logout(String username)
If the application has an admin URL, invalidate the sessions for a particular user directly.
|
GlobalRequestResult |
logoutAll()
If the application has an admin URL, invalidate all sessions associated with that application directly.
|
GlobalRequestResult |
pushRevocation()
If the application has an admin URL, push the application's revocation policy to it.
|
CredentialRepresentation |
regenerateSecret()
Generates a new secret for this application
|
void |
registerNode(Map<String,String> formParams)
Manually register cluster node to this application - 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 by sending 'ping' request to all of them
|
void |
unregisterNode(String node)
Unregister cluster node from this application
|
javax.ws.rs.core.Response |
update(ApplicationRepresentation rep)
Update the application.
|
void |
updateAllowedOrigins(Set<String> allowedOrigins)
Change the set of allowed origins.
|
protected static final org.jboss.logging.Logger logger
protected RealmModel realm
protected ApplicationModel application
protected KeycloakSession session
@Context protected javax.ws.rs.core.UriInfo uriInfo
@Context protected KeycloakApplication keycloak
public ApplicationResource(RealmModel realm, RealmAuth auth, ApplicationModel applicationModel, KeycloakSession session)
protected KeycloakApplication getKeycloakApplication()
@Path(value="protocol-mappers") public ProtocolMappersResource getProtocolMappers()
@PUT @Consumes(value="application/json") public javax.ws.rs.core.Response update(ApplicationRepresentation rep)
rep
- @GET @Produces(value="application/json") public ApplicationRepresentation getApplication()
@Path(value="certificates/{attr}") public ClientAttributeCertificateResource getCertficateResource(@PathParam(value="attr") String attributePrefix)
attributePrefix
- @GET @Path(value="installation/json") @Produces(value="application/json") public String getInstallation() throws IOException
IOException
@GET @Path(value="installation/jboss") @Produces(value="text/plain") public String getJBossInstallation() throws IOException
IOException
@DELETE public void deleteApplication()
@Path(value="client-secret") @POST @Produces(value="application/json") @Consumes(value="application/json") public CredentialRepresentation regenerateSecret()
@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="allowed-origins") @GET @Produces(value="application/json") public Set<String> getAllowedOrigins()
@Path(value="allowed-origins") @PUT @Consumes(value="application/json") public void updateAllowedOrigins(Set<String> allowedOrigins)
allowedOrigins
- @Path(value="allowed-origins") @DELETE @Consumes(value="application/json") public void deleteAllowedOrigins(Set<String> allowedOrigins)
allowedOrigins
- @Path(value="push-revocation") @POST public GlobalRequestResult pushRevocation()
@Path(value="session-count") @GET @Produces(value="application/json") public Map<String,Integer> getApplicationSessionCount()
@Path(value="user-sessions") @GET @Produces(value="application/json") public List<UserSessionRepresentation> getUserSessions(@QueryParam(value="first") Integer firstResult, @QueryParam(value="max") Integer maxResults)
@Path(value="logout-all") @POST public GlobalRequestResult logoutAll()
@Path(value="logout-user/{username}") @POST public void logout(@PathParam(value="username") String username)
@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 public GlobalRequestResult testNodesAvailable()
Copyright © 2015. All rights reserved.