Authenticate A User

To authenticate a user for a Session, invoke the authorize function with the username you are requesting authorization for.

Definition

authorize:@"username"

Parameters

identifier:string Username, user push ID, or Directory User identifier for the user

Flags

isTransactional:boolean Set to true for a transactional (one-way) auth, default is false

Session Example

[[AuthenticationManager sharedClient] authorize:@"identifier" withSuccess:^(NSString *userHash, NSString *authRequest, NSString *deviceId
{
    NSLog(@"success");
} withFailure:^(NSString *errorMessage, NSString *errorCode) {
    NSLog(@"failure");
}];

To authenticate a user for a transaction, invoke the authorize function and set the isTransactional flag to true.

Transaction Example

[[AuthenticationManager sharedClient] authorize:@"identifier" isTransactional:TRUE withSuccess:^(NSString *userHash, NSString *authRequest, NSString *deviceId
{
    NSLog(@"success");
} withFailure:^(NSString *errorMessage, NSString *errorCode) {
    NSLog(@"failure");
}];

This will send an authentication request to the user. Once the user has successfully authorized the request, the withSuccess block will be called and will return the user hash, auth request, app pins and device ID. If an error occurs, the withFailure block will be called and will include an error code and message indicating what went wrong.

Returns - Successful

userHash:Unique string used to identify the user in the future
authRequest:Used to identify the authentication request in subsequent requests
deviceID:User device identifier

Returns - Failed

Click here for an explanation of error codes.

errorMessage:Error message
errorCode:code used to identify error type

User Contributed

LaunchKey links to user contributed code as a resource to its community. LaunchKey does not in any way guarantee or warrant the quality and security of these code bases. User contributed code is supported by the creators. If you do find a link from the site to user contributed code that is malicious or inappropriate in any way, please report that link to LaunchKey immediately and we will investigate the claim. Submit any issue to LaunchKey support at https://launchkey.com./support. ×