Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Next »

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.


ValidateUserTask
// 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.
        }
    }
});
  • No labels