A sample Ionic 5.x and iOS Swift application demonstrating the Mobile Authentication feature using One Time Password, the use of the SMS OTP Login Security Check to protect an IBM MobileFirst Platform Resource Adapter. This will allow application to authenticate a user using SMS with the Twilo Messaging Service.
- Understanding the IBM MobileFirst Foundation Authentication and Security.
- Understanding the IBM MobileFirst Foundation Java Adapters.
- Pre-installed IBM MobileFirst Foundation development environment
- Understanding the Twilio Service
-
Deploy SMSOTP Adapter by running following commands in the project's root directory using command line:
- Run
cd SmsOTPAdapter
- Run
mfpdev adapter build
- Run
mfpdev adapter deploy
- Run
-
From your command line run
mfpdev server console
- this command will open your server console.- From the Adapters menu click on SMS OTP Adapter and navigate to Security Checks tab.
- Here you will find place to add Twilio API SID, Twilio API Token and From phone Number.
- These API Credentials and Phone number can be retreived from Twilio Console
-
From a command-line window, navigate to the project's root folder and run the following commands:
cd IonicSample
- to navigate to ionic sample folder.ionic cordova platform add ios
orionic cordova platform add android
- to add a platform.mfpdev app register
- to register the application.ionic cordova run
- to run the application.
-
Register and Login to the application with your personal mobile phone number.
-
From a command-line window, navigate to the project's root folder and run the following commands:
cd SwiftiOSSample
- to navigate to iOS sample folder.pod update
followed bypod install
- to add the MobileFirst SDK.mfpdev app register
- to register the application.
-
Run the application in the iOS Simulator or physical device. Register & Login to the application with your personal mobile phone number.
- Ionic 5.1.0
- Swift 5.0
IBM MobileFirst Foundation 8.0
Copyright 2020 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.s