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
}
|
ClaimResource |
getClaimResource()
base path for managing allowed application claims
|
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() |
RoleContainerResource |
getRoleContainerResource() |
ScopeMappedResource |
getScopeMappedResource()
Base path for managing the scope mappings for this application
|
SessionStats |
getSessionStats(boolean users)
If the application has an admin URL, query it directly for session stats.
|
List<UserSessionRepresentation> |
getUserSessions()
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.
|
void |
logoutAll()
If the application has an admin URL, invalidate all sessions associated with that application directly.
|
void |
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
|
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="claims") public ClaimResource getClaimResource()
@PUT @Consumes(value="application/json") public javax.ws.rs.core.Response update(ApplicationRepresentation rep)
rep
- @GET @Produces(value="application/json") public ApplicationRepresentation getApplication()
@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 void pushRevocation()
@Path(value="session-stats") @GET @Produces(value="application/json") public SessionStats getSessionStats(@QueryParam(value="users")@DefaultValue(value="false") boolean users)
users
- whether to include users logged in.@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()
@Path(value="logout-all") @POST public void logoutAll()
@Path(value="logout-user/{username}") @POST public void logout(@PathParam(value="username") String username)
Copyright © 2014. All Rights Reserved.