How to search for users by ID and customData in Stormpath

I am thinking about using the Stormpath with it Java API as user repository.

It looks good, except that I cannot search for users.

For example, I get this error:

Exception in thread "main" com.stormpath.sdk.resource.ResourceException: HTTP 400, Stormpath 2105 (http://docs.stormpath.com/errors/2105): Account ID is not a supported query property.

when i execute this request:

HashMap<String, Object> queryParams = Maps.newHashMap();
queryParams.put("ID", "4mPXXXXXXXXXX");
searchResult = application.getAccounts(queryParams);

However, email user search works. I get the same error when I try to search for a user using the login token stored in the customData property.

It seems that what I want to do is impossible, as it seems that the only properties you can request are email and username. But why do they provide this functionality if it does not work. What am I missing?

+4
source share
1

REST API. id, , API REST ( - HTTP). URL (href) "" . , REST API - href. href ( "id", ..) REST . URL- HTTP REST.

, SDK Stormpath RESTful, Stormpath client.getResource, href , , href

String href = "https://api.stormpath.com/v1/accounts/" + id;
Account account = client.getResource(href, Account.class);

, , API- , , client.getAccount(String id), . , , , .

Account, . Stormpath Custom Data . Stormpath , , .

, , , , , , . , " " , , . , . !

+7

All Articles