-
Notifications
You must be signed in to change notification settings - Fork 145
Closed
Labels
feature requestA feature has been asked for or suggested by the communityA feature has been asked for or suggested by the community
Description
Describe the problem you'd like to have solved
Current auth0-java SDK does not provide filter option to "get Client By Id" API, which is available in auth0-management API
Please see attachment

This feature is useful if we intend to read only limited client fields.
Describe the ideal solution
Adding new method to ClientsEntity.java, which accepts "FieldsFilter" parameter. This way it won't impact existing get method
public Request<Client> get(String clientId, FieldsFilter filter) {
Asserts.assertNotNull(clientId, "client id");
HttpUrl.Builder builder = baseUrl
.newBuilder()
.addPathSegments("api/v2/clients")
.addPathSegment(clientId);
if (filter != null) {
for (Map.Entry<String, Object> e : filter.getAsMap().entrySet()) {
builder.addQueryParameter(e.getKey(), String.valueOf(e.getValue()));
}
}
String url = builder.build().toString();
CustomRequest<Client> request = new CustomRequest<>(client, url, "GET", new TypeReference<Client>() {
});
request.addHeader("Authorization", "Bearer " + apiToken);
return request;
}
Alternatives and current work-arounds
Additional information, if any
PR is created to address this #449
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestA feature has been asked for or suggested by the communityA feature has been asked for or suggested by the community