-
Couldn't load subscription status.
- Fork 25
Open
Description
I want to save some custom data for the stormpath user account. As explained in the docs, I have called saveIdentity() of OAuthUser class after setting some data as below:
OAuthUser user = users.getIdentity();
user.data.put("location", "Pune, India");
user.data.put("gender", "Male");
user.saveIdentity(new OAuthUserCallback() {
@Override
public void onFinished() {
}
@Override
public void onError(String message) {
}
});
When I looked inside the method definition, I have found that it does not call post rather it calls get() of OAuthJSONRequest class.
public void saveIdentity(final OAuthUserCallback callback) {
String url = _oauth.getOAuthdURL() + "/api/usermanagement/user?k=" + _oauth.getPublicKey() + "&token=" + token;
JSONObject postdata = new JSONObject();
try {
Iterator it = data.keySet().iterator();
while (it.hasNext()) {
String key = (String) it.next();
postdata.put(key, data.get(key));
}
} catch (JSONException e) {
callback.onError(e.getMessage());
return;
}
new OAuthJSONRequest().get(url, new OAuthJSONCallback() {
@Override
public void onFinished(JSONObject data) {
callback.onFinished();
}
@Override
public void onError(String message) {
callback.onError(message);
}
});
}
Link to StackOverflow question: http://stackoverflow.com/q/34082103/1567675
Metadata
Metadata
Assignees
Labels
No labels