objectClass("User") {
search {
endpoint("/users/search") {
objectExtractor {
return response.body().get("users")
}
pagingSupport {
request.queryParameter("size", paging.pageSize)
.queryParameter("offset", paging.pageOffset)
}
}
}
}
Implement basic user search
How to implement basic user search in a SCIMREST connector using a Groovy script, including endpoint configuration, object extraction, and paging support.
Write a Groovy script User.search.groovy which handles search of the
object class User.
The Groovy script should look like:
Where:
-
endpoint- method takes an search / list endpoint as an argument. -
objectExtractor- optional, it is used to extract a list of objects fromresponse.body()in javaorg.json.JSONObjectformat. -
paggingSupport- optional, allows to specify paging information in therequest -
Paging information is available in
pagingobject with -
pageSizerepresenting size of requested page -
pageOffsetrepresenting size number of page to be returned (first page has offset 1) -
requestis object used to customize request. You can usequeryParamater(name, value)to add HTTP query parameters to request.
GET /users/search
Search for users
Parameters
| Name | Type | Description |
|---|---|---|
q |
string (query) |
keyword |
uid |
integer($int64) (query) |
ID of the user to search for |
page |
integer (query) |
page number of results to return (1-based) |
limit |
integer (query) |
page size of results |
Responses
-
200- SearchResults of a successful search
Example value:
{
"data": [
{
"active": true,
"avatar_url": "string",
"created": "2025-05-05T12:10:33.653Z",
"description": "string",
"email": "user@example.com",
"followers_count": 0,
"following_count": 0,
"full_name": "string",
"html_url": "string",
"id": 0,
"is_admin": true,
"language": "string",
"last_login": "2025-05-05T12:10:33.653Z",
"location": "string",
"login": "string",
"login_name": "empty",
"prohibit_login": true,
"pronouns": "string",
"restricted": true,
"source_id": 0,
"starred_repos_count": 0,
"visibility": "string",
"website": "string"
}
],
"ok": true
}