You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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);
}
});
}
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:
When I looked inside the method definition, I have found that it does not call post rather it calls get() of OAuthJSONRequest class.
Link to StackOverflow question: http://stackoverflow.com/q/34082103/1567675
The text was updated successfully, but these errors were encountered: