Futurae iOS Mobile Auth SDK (FTMobileAuthSDK)

Installation

FTMobileAuthSDK is currently only available through this git repository. To install it, simply add the following line to your Podfile:

pod 'FTMobileAuthSDK', :git => 'git@git.futurae.com:futurae/mobile-auth-ios-sdk.git', '~> 0.1.0'

Example Project

An example project can be found here, which also includes TODO comments to indicate where actions are required and demonstrates how the SDK communicates with the application.

The following steps are required to run the example project:

  1. Install CocoaPods.
  2. Clone the repo, and run pod install from the Example directory.
  3. Configure the SDK by modifying the FTMobileAuthSDK-Info.plist file according to your Futurae setup. See the FTConfig docs for examples.
  4. Integrate the Futurae Auth API such that you can start a new mobile_auth factor and retrieve a SessionToken.
  5. Register the correct Service URL and App IDs according to Futurae Auth API reference docs.
  6. Build and run the example project.

Usage

To include MobileAuth in your own app, follow these steps:

  1. Install the FTMobileAuthSDK pod according to the installation instructions.
  2. Configure the SDK by modifying the FTMobileAuthSDK-Info.plist file according to your Futurae setup. See the FTConfig docs for examples.
  3. Integrate the Futurae Auth API such that you can start a new mobile_auth factor and retrieve a SessionToken.
  4. Make sure that all MobileAuth related URL Scheme calls are forwarded to the FTMobileAuthManager. See the FTMobileAuthManager docs for an example.
  5. Implement all delegate methods of the FTMobileAuthManagerDelegate and register the responsible ViewController as the delegate:

    [FTMobileAuthManager sharedManager].delegate = self;
    
  6. To start a new MobileAuth session, perform the corresponding Futurae Auth API call to retrieve a SessionToken. Once you have the SessionToken, forward it to the FTMobileAuthManager like this:

    [[FTMobileAuthManager sharedManager] start:self.sessionToken]
    
  7. The FTMobileAuthManager now automatically handles the MobileAuth session and reports the status to the corresponding FTMobileAuthManagerDelegate method. Check the FTMobileAuthManagerDelegate docs or the example project to see how the delegates should be handled.

MobileAuth Enrollment

When a user tries to use MobileAuth for the first time, a new MobileAuthClient needs to be enrolled first. If this is the case, the mobileAuthManagerEnrollmentRequired delegate is called and the enrollment can be initiated as follows:

[[FTMobileAuthManager sharedManager] enroll:self.sessionToken];

MobileAuthClient

Typically, one does not need to interact with the FTMobileAuthClient manually and the FTMobileAuthManager takes care of everything. However, it may be useful for demo purposes to delete the MobileAuthClient, such that the enrollment process can be repeated.

To delete a MobileAuthClient, run the following code:

[[FTMobileAuthManager sharedManager] removeClient];

Documentation

The documentation can be found here.

Dependencies

The following Pods will be installed when installing the FTMobileAuthSDK:

Author

Futurae Technologies AG, info@futurae.com

License

FTMobileAuthSDK is available under the MIT license. See the LICENSE file for more info.