Getting started with iOS in PingID SDK

This topic details the implementation steps of the PingID SDK flows and logic, which are described in Multifactor authentication (MFA) methods and User device pairing.

PingID SDK supports the following software versions:

  • Xcode 8 and above.
  • iOS 8.0 and above.
  1. Retrieve the organization account alias from the pingidsdk.properties file: Download the settings file:

    In the PingOne web portal, Setup > PingID > CLIENT INTEGRATION > INTEGRATE WITH PINGID SDK > SETTINGS FILE > Download.

  2. Retrieve the Application ID of your PingID SDK application: In the PingOne web portal, go to Applications > PingID SDK Applications.

    The Application ID is displayed under the application’s name.

  3. Configure remote notification: If you intend to use push messaging in your app, you should have your Apple iOS Push Services Certificate ready. Upload the certificate in the PingOne web portal: Go to Setup > Certificates.

  4. Add the PingID SDK component into your existing project:

    1. In your Project Navigator, click on your target, and drag PingID_SDK.framework to Embedded Binaries.
    2. Check the Copy items if needed checkbox.
  5. Enable location:

    PingID SDK uses location, if it is available. Regardless, add the NSLocationWhenInUseUsageDescription to your info.plist with a short description, implement CLLocationManager, and ask for location permissions.

  6. Setup the Run Script phase:

    • Make sure that the Run Script phase is after the Embed Frameworks phase.

    • Select your application’s Xcode project, then your application target, and then select Build Phases, click +, and then New Run Script Build Phase.

    • Paste the following line into the body of the Run Script Build Phase:bash "${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/PingID_SDK.framework/strip-frameworks.sh"

  7. Integrate the PingID SDK component into your code:

    • Initialize the PingID SDK singleton. Import the framework into your application initialization code :

      #import <PingID_SDK/PingID.h>

    • Call the initWithAppID method, passing the Application ID retrieved from the PingOne web portal, when the application was created.

      • Retrieve the Application ID:

        Go to Applications > PingID SDK Applications.

        The Application ID is displayed under the application’s name.

      • Call the initWithAppID:supportedMfa: method with the required registration mode for pairing (MFA type):

        PingID initWithAppID:##YOUR_APP_ID_HERE## supportedMfa:##PIDSupportedMfaType##;
        Registration mode value Description
        PIDSupportedMfaTypeAutomatic MFA supports remote notifications with automatic fallback to one time passcode.
        PIDSupportedMfaTypeRemoteNotification MFA supports remote notifications only.
        PIDSupportedMfaTypeOneTimePasscode MFA supports one time passcode only, and will not support remote notifications.

        Make sure that this method is called at the beginning of your AppDelegate application::didFinishLaunchingWithOptions: method.

    • Integrate the PingID SDK component into the authentication process.

      • Invoke the generatePayload function on every login attempt.

      • In the login request to the customer server, add a string parameter, for passing the payload from the customer mobile application’s PingID SDK component.

      • In the authentication request, you’ll receive information regarding the result of the PingID SDK multifactor authentication.

  8. Sign the application certificate.