Integrate QR code authenticator

This topic enables the iOS mobile app to integrate a QR code authenticator using the SDK

The CyberArk Identity iOS SDK provides highly secure and trusted multi-factor authentication (MFA) to your web app using the QR code authenticator. Use the SDK to integrate the QR code authenticator into the iOS mobile app and leverage the CyberArk Identity's QR code authentication mechanism.

📘

Prerequisites

  1. An access token should be generated for the user and used to send the API calls for device enrollment. The access token can be generated using the OIDC authorization code with PKCE grant.

  2. The mobile device must be enrolled to CyberArk Identity to leverage the QR code authenticator. The Android SDK provides the capability to enroll the device to CyberArk Identity.

How it works?

1166

Integrate the QR code authenticator in your app

The QR code login model is as follows:

let provider = QRAuthenticationProvider()
// To Scan the QR code
    func scanQRCode() {
        provider.authenticateWithQRCode(presenter: self, completion: { [weak self] result in
            switch result {
            case .success(_): 
                //Handle success case here
            case .failure(let error):
               //Handle error case here    
            }

        })
    }