public class RealmAdminResource extends Object
Modifier and Type | Field and Description |
---|---|
protected AdminPermissionEvaluator |
auth |
protected ClientConnection |
connection |
protected javax.ws.rs.core.HttpHeaders |
headers |
protected static org.jboss.logging.Logger |
logger |
protected RealmModel |
realm |
protected KeycloakSession |
session |
Constructor and Description |
---|
RealmAdminResource(AdminPermissionEvaluator auth,
RealmModel realm,
TokenManager tokenManager,
AdminEventBuilder adminEvent) |
Modifier and Type | Method and Description |
---|---|
void |
addDefaultDefaultClientScope(String clientScopeId) |
void |
addDefaultGroup(String groupId) |
void |
addDefaultOptionalClientScope(String clientScopeId) |
void |
clearAdminEvents()
Delete all admin events
|
void |
clearEvents()
Delete all events
|
void |
clearKeysCache()
Clear cache of external public keys (Public keys of clients or Identity providers)
|
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
|
ClientRegistrationPolicyResource |
getClientRegistrationPolicy() |
ClientsResource |
getClients()
Base path for managing clients under this realm.
|
ClientScopesResource |
getClientScopes()
Base path for managing client scopes under this realm.
|
List<Map<String,String>> |
getClientSessionStats()
Get client session stats
Returns a JSON map.
|
ClientScopesResource |
getClientTemplates()
Deprecated.
|
ComponentResource |
getComponents()
Base path for managing components under this realm.
|
List<String> |
getCredentialRegistrators() |
List<ClientScopeRepresentation> |
getDefaultDefaultClientScopes()
Get realm default client scopes.
|
List<GroupRepresentation> |
getDefaultGroups()
Get group hierarchy.
|
List<ClientScopeRepresentation> |
getDefaultOptionalClientScopes()
Get realm optional client scopes.
|
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
|
ManagementPermissionReference |
getUserMgmtPermissions() |
KeyResource |
keys() |
GlobalRequestResult |
logoutAll()
Removes all user sessions.
|
RealmRepresentation |
partialExport(Boolean exportGroupsAndRoles,
Boolean exportClients)
Partial export of existing realm into a JSON file.
|
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 |
removeDefaultDefaultClientScope(String clientScopeId) |
void |
removeDefaultGroup(String groupId) |
void |
removeDefaultOptionalClientScope(String clientScopeId) |
RoleByIdResource |
rolesById()
Path for managing all realm-level or client-level roles defined in this realm by its id.
|
ManagementPermissionReference |
setUsersManagementPermissionsEnabled(ManagementPermissionReference ref) |
javax.ws.rs.core.Response |
testLDAPConnection(String action,
String connectionUrl,
String bindDn,
String bindCredential,
String useTruststoreSpi,
String connectionTimeout,
String componentId,
String startTls)
Deprecated.
|
javax.ws.rs.core.Response |
testLDAPConnection(TestLdapConnectionRepresentation config)
Test LDAP connection
|
javax.ws.rs.core.Response |
testSMTPConnection(Map<String,String> settings) |
javax.ws.rs.core.Response |
testSMTPConnection(String config)
Deprecated.
|
static ManagementPermissionReference |
toUsersMgmtRef(AdminPermissionManagement permissions) |
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
|
UsersResource |
users()
Base path for managing users in this realm.
|
UserStorageProviderResource |
userStorage() |
protected static final org.jboss.logging.Logger logger
protected AdminPermissionEvaluator auth
protected RealmModel realm
@Context protected KeycloakSession session
@Context protected ClientConnection connection
@Context protected javax.ws.rs.core.HttpHeaders headers
public RealmAdminResource(AdminPermissionEvaluator 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()
@Deprecated @Path(value="client-templates") public ClientScopesResource getClientTemplates()
getClientScopes()
instead@Path(value="client-scopes") public ClientScopesResource getClientScopes()
@GET @Produces(value="application/json") @Path(value="default-default-client-scopes") public List<ClientScopeRepresentation> getDefaultDefaultClientScopes()
@PUT @Path(value="default-default-client-scopes/{clientScopeId}") public void addDefaultDefaultClientScope(@PathParam(value="clientScopeId") String clientScopeId)
@DELETE @Path(value="default-default-client-scopes/{clientScopeId}") public void removeDefaultDefaultClientScope(@PathParam(value="clientScopeId") String clientScopeId)
@GET @Produces(value="application/json") @Path(value="default-optional-client-scopes") public List<ClientScopeRepresentation> getDefaultOptionalClientScopes()
@PUT @Path(value="default-optional-client-scopes/{clientScopeId}") public void addDefaultOptionalClientScope(@PathParam(value="clientScopeId") String clientScopeId)
@DELETE @Path(value="default-optional-client-scopes/{clientScopeId}") public void removeDefaultOptionalClientScope(@PathParam(value="clientScopeId") String clientScopeId)
@Path(value="clients-initial-access") public ClientInitialAccessResource getClientInitialAccess()
@Path(value="client-registration-policy") public ClientRegistrationPolicyResource getClientRegistrationPolicy()
@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()
@GET @Produces(value="application/json") @Path(value="users-management-permissions") public ManagementPermissionReference getUserMgmtPermissions()
@PUT @Produces(value="application/json") @Consumes(value="application/json") @Path(value="users-management-permissions") public ManagementPermissionReference setUsersManagementPermissionsEnabled(ManagementPermissionReference ref)
public static ManagementPermissionReference toUsersMgmtRef(AdminPermissionManagement permissions)
@Path(value="user-storage") public UserStorageProviderResource userStorage()
@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
- Maximum results size (defaults to 100)@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
- Maximum results size (defaults to 100)@Path(value="events") @DELETE public void clearEvents()
@Path(value="admin-events") @DELETE public void clearAdminEvents()
@Path(value="testLDAPConnection") @POST @Consumes(value="application/x-www-form-urlencoded") @Deprecated public javax.ws.rs.core.Response testLDAPConnection(@FormParam(value="action") String action, @FormParam(value="connectionUrl") String connectionUrl, @FormParam(value="bindDn") String bindDn, @FormParam(value="bindCredential") String bindCredential, @FormParam(value="useTruststoreSpi") String useTruststoreSpi, @FormParam(value="connectionTimeout") String connectionTimeout, @FormParam(value="componentId") String componentId, @FormParam(value="startTls") String startTls)
action
- connectionUrl
- bindDn
- bindCredential
- @Path(value="testLDAPConnection") @POST @Consumes(value="application/json") public javax.ws.rs.core.Response testLDAPConnection(TestLdapConnectionRepresentation config)
@Path(value="testSMTPConnection") @POST @Consumes(value="application/x-www-form-urlencoded") @Deprecated public javax.ws.rs.core.Response testSMTPConnection(@FormParam(value="config") String config) throws Exception
config
- SMTP server configurationException
@Path(value="testSMTPConnection") @POST @Consumes(value="application/json") public javax.ws.rs.core.Response testSMTPConnection(Map<String,String> settings) throws Exception
Exception
@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="partial-export") @POST @Produces(value="application/json") public RealmRepresentation partialExport(@QueryParam(value="exportGroupsAndRoles") Boolean exportGroupsAndRoles, @QueryParam(value="exportClients") Boolean exportClients)
exportGroupsAndRoles
- exportClients
- @Path(value="clear-realm-cache") @POST public void clearRealmCache()
@Path(value="clear-user-cache") @POST public void clearUserCache()
@Path(value="clear-keys-cache") @POST public void clearKeysCache()
@Path(value="keys") public KeyResource keys()
Copyright © 2020 JBoss by Red Hat. All rights reserved.