Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Used to verify a user's credentials.

On success, a session token will be returned that will be used to securely make calls to other REST API tasks.


Code Block
languagejava
themeEclipse
titleValidateUserTask
linenumberstrue
// This only needs to be executed one for the lifetime of the app.
SurePassServerTask.setSurePassServer("www.surepassid.com");

String username = "demouser";
String password = "demosecret";

ValidateUserTaskParams params = new ValidateUserTaskParams(username, password);

new ValidateUserTask().run(params, new ValidateUserTaskListener() {
    @Override
    public void onResult(ValidateUserTaskResult result) {
        if (result.getErrorCode() == 0) {
            // The username and password were valid.
        } else if (result.getErrorCode() == USER_VALIDATION_FAILED_ERROR) {
            // The username or password was incorrect.
        } else {
            // An error occured while processing the request.
        }
    }
});

...