This guide will show you how to implement the user authentication in a iOS application . For this tutorial, we will use the iOS demo from GitHub and show you step by step how to run it.
This tutorial assumes you have:
Get your credentials and whitelist your application domain as explained in this section. This is a mandatory step to successfully implement and run the demo.
Generating your SOTT:
You will need to pass a SOTT value at the time of registration. You can generate this in the Configuration section of your Dashboard.
To access Secure Mobile OTP Token configuration, login to your LoginRadius Dashboard account, from the left navigation panel, click the Configuration and then navigate to the API Credentials section.
Click the down arrow or anywhere within the section and Open the Secure Mobile OTP Token subsection, the below screen will appear:
You can clone the demo repository on your system using below commands:
git clone email@example.com:LoginRadius/ios-sdk.git
git clone https://github.com/LoginRadius/ios-sdk.git
Now install demo in your Xcode Studio.
Install the SDK via CocoaPods
To create Pod file run the following command in terminal
$ pod init
To integrate LoginRadiusSDK into your Xcode project using CocoaPods, specify it in your
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '9.0' target 'TargetName' do pod 'LoginRadiusSDK', '~> 5.4.1' end
Then, run the following command:
- Create a plist file named LoginRadius.plist and add the following code.
<key>apiKey</key> <string>Enter your loginradius api key</string> <key>siteName</key> <string>Enter your loginradius site name</string>
- In Xcode, right-click on your project's .plist file and select Open As -> Source Code.Default plist is usually your Info.plist file
- Insert the value for url scheme with this.
<Your site name>.<Your Bundle Identifier>
- Run your project
- Email Verification
- Forgot Password
- Reset Password