public class RealmAdminResource extends Object
Modifier and Type | Field and Description |
---|---|
protected RealmAuth |
auth |
protected ClientConnection |
connection |
protected javax.ws.rs.core.HttpHeaders |
headers |
protected static ServicesLogger |
logger |
protected RealmModel |
realm |
protected KeycloakSession |
session |
protected javax.ws.rs.core.UriInfo |
uriInfo |
Constructor and Description |
---|
RealmAdminResource(RealmAuth auth,
RealmModel realm,
TokenManager tokenManager,
AdminEventBuilder adminEvent) |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultGroup(String groupId) |
void |
clearAdminEvents()
Delete all admin events
|
void |
clearEvents()
Delete all events
|
void |
clearRealmCache()
Clear realm cache
|
void |
clearUserCache()
Clear user cache
|
ClientRepresentation |
convertClientDescription(String description)
Base path for importing clients under this realm.
|
void |
deleteRealm()
Delete the realm
|
void |
deleteSession(String sessionId)
Remove a specific user session.
|
AuthenticationManagementResource |
flows() |
AttackDetectionResource |
getAttackDetection()
Base path for managing attack detection.
|
ClientInitialAccessResource |
getClientInitialAccess()
Base path for managing client initial access tokens
|
ClientsResource |
getClients()
Base path for managing clients under this realm.
|
List<Map<String,String>> |
getClientSessionStats()
Get client session stats
Returns a JSON map.
|
ClientTemplatesResource |
getClientTemplates()
Base path for managing client templates under this realm.
|
ComponentResource |
getComponents()
Base path for managing components under this realm.
|
List<GroupRepresentation> |
getDefaultGroups()
Get group hierarchy.
|
List<EventRepresentation> |
getEvents(List<String> types,
String client,
String user,
String dateFrom,
String dateTo,
String ipAddress,
Integer firstResult,
Integer maxResults)
Get events
Returns all events, or filters them based on URL query parameters listed here
|
List<AdminEventRepresentation> |
getEvents(List<String> operationTypes,
String authRealm,
String authClient,
String authUser,
String authIpAddress,
String resourcePath,
String dateFrom,
String dateTo,
Integer firstResult,
Integer maxResults,
List<String> resourceTypes)
Get admin events
Returns all admin events, or filters events based on URL query parameters listed here
|
GroupRepresentation |
getGroupByPath(String path) |
GroupsResource |
getGroups() |
IdentityProvidersResource |
getIdentityProviderResource() |
RealmRepresentation |
getRealm()
Get the top-level representation of the realm
It will not include nested information like User and Client representations.
|
RealmEventsConfigRepresentation |
getRealmEventsConfig()
Get the events provider configuration
Returns JSON object with events provider configuration
|
RoleContainerResource |
getRoleContainerResource()
base path for managing realm-level roles of this realm
|
GlobalRequestResult |
logoutAll()
Removes all user sessions.
|
javax.ws.rs.core.Response |
partialImport(PartialImportRepresentation rep)
Partial import from a JSON file to an existing realm.
|
GlobalRequestResult |
pushRevocation()
Push the realm's revocation policy to any client that has an admin url associated with it.
|
void |
removeDefaultGroup(String groupId) |
RoleByIdResource |
rolesById()
Path for managing all realm-level or client-level roles defined in this realm by its id.
|
javax.ws.rs.core.Response |
testLDAPConnection(String action,
String connectionUrl,
String bindDn,
String bindCredential,
String useTruststoreSpi)
Test LDAP connection
|
javax.ws.rs.core.Response |
updateRealm(RealmRepresentation rep)
Update the top-level information of the realm
Any user, roles or client information in the representation
will be ignored.
|
void |
updateRealmEventsConfig(RealmEventsConfigRepresentation rep)
Update the events provider
Change the events provider and/or its configuration
|
UserFederationProvidersResource |
userFederation() |
UsersResource |
users()
Base path for managing users in this realm.
|
protected static final ServicesLogger logger
protected RealmAuth auth
protected RealmModel realm
@Context protected KeycloakSession session
@Context protected javax.ws.rs.core.UriInfo uriInfo
@Context protected ClientConnection connection
@Context protected javax.ws.rs.core.HttpHeaders headers
public RealmAdminResource(RealmAuth auth, RealmModel realm, TokenManager tokenManager, AdminEventBuilder adminEvent)
@Path(value="client-description-converter") @Consumes(value={"application/json","application/xml","text/plain"}) @POST @Produces(value="application/json") public ClientRepresentation convertClientDescription(String description)
@Path(value="attack-detection") public AttackDetectionResource getAttackDetection()
@Path(value="clients") public ClientsResource getClients()
@Path(value="client-templates") public ClientTemplatesResource getClientTemplates()
@Path(value="clients-initial-access") public ClientInitialAccessResource getClientInitialAccess()
@Path(value="components") public ComponentResource getComponents()
@Path(value="roles") public RoleContainerResource getRoleContainerResource()
@GET @Produces(value="application/json") public RealmRepresentation getRealm()
@PUT @Consumes(value="application/json") public javax.ws.rs.core.Response updateRealm(RealmRepresentation rep)
rep
- @DELETE public void deleteRealm()
@Path(value="users") public UsersResource users()
@Path(value="user-federation") public UserFederationProvidersResource userFederation()
@Path(value="authentication") public AuthenticationManagementResource flows()
@Path(value="roles-by-id") public RoleByIdResource rolesById()
@Path(value="push-revocation") @POST public GlobalRequestResult pushRevocation()
@Path(value="logout-all") @POST public GlobalRequestResult logoutAll()
@Path(value="sessions/{session}") @DELETE public void deleteSession(@PathParam(value="session") String sessionId)
sessionId
- @Path(value="client-session-stats") @GET @Produces(value="application/json") public List<Map<String,String>> getClientSessionStats()
@GET @Path(value="events/config") @Produces(value="application/json") public RealmEventsConfigRepresentation getRealmEventsConfig()
@PUT @Path(value="events/config") @Consumes(value="application/json") public void updateRealmEventsConfig(RealmEventsConfigRepresentation rep)
rep
- @Path(value="events") @GET @Produces(value="application/json") public List<EventRepresentation> getEvents(@QueryParam(value="type") List<String> types, @QueryParam(value="client") String client, @QueryParam(value="user") String user, @QueryParam(value="dateFrom") String dateFrom, @QueryParam(value="dateTo") String dateTo, @QueryParam(value="ipAddress") String ipAddress, @QueryParam(value="first") Integer firstResult, @QueryParam(value="max") Integer maxResults)
types
- The types of events to returnclient
- App or oauth client nameuser
- User idipAddress
- IP addressdateTo
- To datedateFrom
- From datefirstResult
- Paging offsetmaxResults
- Paging size@Path(value="admin-events") @GET @Produces(value="application/json") public List<AdminEventRepresentation> getEvents(@QueryParam(value="operationTypes") List<String> operationTypes, @QueryParam(value="authRealm") String authRealm, @QueryParam(value="authClient") String authClient, @QueryParam(value="authUser") String authUser, @QueryParam(value="authIpAddress") String authIpAddress, @QueryParam(value="resourcePath") String resourcePath, @QueryParam(value="dateFrom") String dateFrom, @QueryParam(value="dateTo") String dateTo, @QueryParam(value="first") Integer firstResult, @QueryParam(value="max") Integer maxResults, @QueryParam(value="resourceTypes") List<String> resourceTypes)
operationTypes
- authRealm
- authClient
- authUser
- user idauthIpAddress
- resourcePath
- dateTo
- dateFrom
- firstResult
- maxResults
- @Path(value="events") @DELETE public void clearEvents()
@Path(value="admin-events") @DELETE public void clearAdminEvents()
@Path(value="testLDAPConnection") @GET public javax.ws.rs.core.Response testLDAPConnection(@QueryParam(value="action") String action, @QueryParam(value="connectionUrl") String connectionUrl, @QueryParam(value="bindDn") String bindDn, @QueryParam(value="bindCredential") String bindCredential, @QueryParam(value="useTruststoreSpi") String useTruststoreSpi)
action
- connectionUrl
- bindDn
- bindCredential
- @Path(value="identity-provider") public IdentityProvidersResource getIdentityProviderResource()
@GET @Produces(value="application/json") @Path(value="default-groups") public List<GroupRepresentation> getDefaultGroups()
@PUT @Path(value="default-groups/{groupId}") public void addDefaultGroup(@PathParam(value="groupId") String groupId)
@DELETE @Path(value="default-groups/{groupId}") public void removeDefaultGroup(@PathParam(value="groupId") String groupId)
@Path(value="groups") public GroupsResource getGroups()
@GET @Path(value="group-by-path/{path: .*}") @Produces(value="application/json") public GroupRepresentation getGroupByPath(@PathParam(value="path") String path)
@Path(value="partialImport") @POST @Consumes(value="application/json") public javax.ws.rs.core.Response partialImport(PartialImportRepresentation rep)
rep
- @Path(value="clear-realm-cache") @POST public void clearRealmCache()
@Path(value="clear-user-cache") @POST public void clearUserCache()
Copyright © 2016 JBoss by Red Hat. All rights reserved.