public class UsersResource extends Object
| Modifier and Type | Field and Description |
|---|---|
protected org.keycloak.common.ClientConnection |
clientConnection |
protected javax.ws.rs.core.HttpHeaders |
headers |
protected RealmModel |
realm |
protected KeycloakSession |
session |
protected javax.ws.rs.core.UriInfo |
uriInfo |
| Constructor and Description |
|---|
UsersResource(RealmModel realm,
AdminPermissionEvaluator auth,
AdminEventBuilder adminEvent) |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
createUser(javax.ws.rs.core.UriInfo uriInfo,
UserRepresentation rep)
Create a new user
Username must be unique.
|
List<UserRepresentation> |
getUsers(String search,
String last,
String first,
String email,
String username,
Integer firstResult,
Integer maxResults)
Get users
Returns a list of users, filtered according to query parameters
|
Integer |
getUsersCount() |
UserResource |
user(String id)
Get representation of the user
|
protected RealmModel realm
@Context protected org.keycloak.common.ClientConnection clientConnection
@Context protected javax.ws.rs.core.UriInfo uriInfo
@Context protected KeycloakSession session
@Context protected javax.ws.rs.core.HttpHeaders headers
public UsersResource(RealmModel realm, AdminPermissionEvaluator auth, AdminEventBuilder adminEvent)
@POST
@Consumes(value="application/json")
public javax.ws.rs.core.Response createUser(@Context
javax.ws.rs.core.UriInfo uriInfo,
UserRepresentation rep)
uriInfo - rep - @Path(value="{id}")
public UserResource user(@PathParam(value="id")
String id)
id - User id@GET @Produces(value="application/json") public List<UserRepresentation> getUsers(@QueryParam(value="search") String search, @QueryParam(value="lastName") String last, @QueryParam(value="firstName") String first, @QueryParam(value="email") String email, @QueryParam(value="username") String username, @QueryParam(value="first") Integer firstResult, @QueryParam(value="max") Integer maxResults)
search - A String contained in username, first or last name, or emaillast - first - email - username - first - Pagination offsetmaxResults - Maximum results size (defaults to 100)@Path(value="count") @GET @Produces(value="application/json") public Integer getUsersCount()
Copyright © 2018 JBoss by Red Hat. All rights reserved.