use of org.keycloak.services.managers.ResourceAdminManager in project keycloak by keycloak.
the class RealmAdminResource method pushRevocation.
/**
* Push the realm's revocation policy to any client that has an admin url associated with it.
*/
@Path("push-revocation")
@POST
public GlobalRequestResult pushRevocation() {
auth.realm().requireManageRealm();
GlobalRequestResult result = new ResourceAdminManager(session).pushRealmRevocationPolicy(realm);
adminEvent.operation(OperationType.ACTION).resourcePath(session.getContext().getUri()).representation(result).success();
return result;
}
use of org.keycloak.services.managers.ResourceAdminManager in project keycloak by keycloak.
the class RealmAdminResource method logoutAll.
/**
* Removes all user sessions. Any client that has an admin url will also be told to invalidate any sessions
* they have.
*/
@Path("logout-all")
@POST
@Produces(MediaType.APPLICATION_JSON)
public GlobalRequestResult logoutAll() {
auth.users().requireManage();
session.sessions().removeUserSessions(realm);
GlobalRequestResult result = new ResourceAdminManager(session).logoutAll(realm);
adminEvent.operation(OperationType.ACTION).resourcePath(session.getContext().getUri()).representation(result).success();
return result;
}
use of org.keycloak.services.managers.ResourceAdminManager in project keycloak by keycloak.
the class ClientResource method pushRevocation.
/**
* Push the client's revocation policy to its admin URL
*
* If the client has an admin URL, push revocation policy to it.
*/
@Path("push-revocation")
@POST
@Produces(MediaType.APPLICATION_JSON)
public GlobalRequestResult pushRevocation() {
auth.clients().requireConfigure(client);
adminEvent.operation(OperationType.ACTION).resourcePath(session.getContext().getUri()).resource(ResourceType.CLIENT).success();
return new ResourceAdminManager(session).pushClientRevocationPolicy(realm, client);
}
use of org.keycloak.services.managers.ResourceAdminManager in project keycloak by keycloak.
the class ClientResource method testNodesAvailable.
/**
* Test if registered cluster nodes are available
*
* Tests availability by sending 'ping' request to all cluster nodes.
*
* @return
*/
@Path("test-nodes-available")
@GET
@NoCache
@Produces(MediaType.APPLICATION_JSON)
public GlobalRequestResult testNodesAvailable() {
auth.clients().requireConfigure(client);
logger.debug("Test availability of cluster nodes");
GlobalRequestResult result = new ResourceAdminManager(session).testNodesAvailability(realm, client);
adminEvent.operation(OperationType.ACTION).resource(ResourceType.CLUSTER_NODE).resourcePath(session.getContext().getUri()).representation(result).success();
return result;
}
Aggregations