Two Factor Authentication (2FA)

Webex Connect Two Factor Authentication (2FA) is an authentication process in which the user provides two means of identification from separate categories of credentials. It provides additional security. For example, a banking transaction a user may be asked to provide one-time password (OTP) after they log in with their username and password.

Webex Connect SDK provides Two Factor Authentication (2FA) service for mobile applications to validate their customer id (CRN and MSISDN) that are registered with Webex Connect profile manager. The OTP is valid for 30 minutes.

This interface has the following class:

ICUserAuthentication

This class exposes functionality that enables user authentication through a One Time Password sent over SMS. Two Factor Authentication (2FA) can also be implemented using this class.

Methods

generatePinForUserId

This method is used to generate a pin and sent it to the user through SMS allowing him to authenticate with a pin than the traditional login/password. The phone number must be provided when creating a user profile. If generation succeeds, error in completionHandler will be nil.

  Syntax: + (void)generatePinForUserId:(NSString *)userId completionHandler:(void (^)(NSError *error)) completionHandler;

  Parameters:

ParameterTypeDescription
userIdNSStringSpecifies a user id or customer id (CRN and MSISDN) that are registered with Webex Connect profile manager.

  Example:

[ICUserAuthentication generatePinForUserId: userId
    completionHandler: ^ (NSError * error) {
        if (error) {
            NSLog(@ "Failed to generate PIN. Reason: %@", error.localizedDescription);
        } else {
            NSLog(@ "Generation succeeded.");
        }
    }
];

validatePin

This method is used to validate the pin with the Webex Connect platform. The result is reported through the callback specified when constructing the ICUserAuthentication instance. If validation succeeds, error in completionHandler will be nil.

  Syntax: + (void)validatePin:(NSString *)pin forUserId:(NSString *)userId completionHandler:(void (^)(NSError *error))completionHandler;

  Parameters:

ParameterTypeDescription
pinNSStringSpecifies the pin number to be validated that is received as SMS.
userIdNSStringSpecifies a user id or customer id (CRN and MSISDN) that are registered with Webex Connect profile manager.

Example:

[ICUserAuthentication validatePin: pin
    forUserId: userId
    completionHandler: ^ (NSError * error) {
        if (error) {
            NSLog(@ "Failed to authenticate the user. Reason: %@", error.localizedDescription);
        } else {
            NSLog(@ "Authentication succeeded.");
        }
    }
];