android - Parse : invalid username, password -
i using parse api databases , trying use username service provides. understand tutorial in order login :
parseuser.logininbackground("jerry", "showmethemoney", new logincallback() { public void done(parseuser user, parseexception e) { if (user != null) { // hooray! user logged in. } else { // signup failed. @ parseexception see happened. } } });
if login failed, wondering how tell whether failed because username typed in invalid, or password. know can e.getcode() type of error occurred, site https://parse.com/docs/android/api/ couldn't find error codes pertaining invalid username/password
thank james
this did check username/password validity in 1 of applications. method submits query against parseuser class , returns true if passed username exists, if know username valid.
(check externally parseexception.object_not_found - in conjunction can tell whether user needs register or has invalid password.)
public boolean querycredentials(string username) { parsequery<parseuser> queryuserlist = parseuser.getquery(); queryuserlist.whereequalto("username", username); try { //attempt find user specified credentials. return (queryuserlist.count() != 0) ? true : false; } catch (parseexception e) { return false; } }
hopefully can issue.
Comments
Post a Comment