Giter VIP home page Giter VIP logo

sim-card-auth-ios's Introduction

SIM Card Based Mobile Authentication with iOS

This sample iOS project will help you perform your first SubscriberCheck with an iOS device and a sim card. You can follow the tutorial at [How to build ]understand the steps you should follow to integratetru.ID. tru.ID SubscriberCheck to you applications.

License

Before you begin

You will need to:

  • Download Xcode 12
  • Register for a developer account at Apple Developer Portal if you do not have one already
  • Have an iPhone or an iPad with a sim card
  • Have a data plan from your network Operator for your sim

Getting Started

Before you can start running the sample project, there are few things you should to set-up. First, you need to install the tru.ID CLI. This will help you create a development server up and running, which the sample app will be using to accomplish the necessary steps for SubscriberCheck set it up using the command provided in the tru.ID console:

$ tru setup:credentials {client_id} {client_secret} {data_residency}

Install the development server plugin:

$ tru plugins:install @tru_id/cli-plugin-dev-server@canary

Create a tru.ID project:

$ tru projects:create authsome-ios

Run the development server and take a note of the local tunnel URL:

$ tru server --project-dir ./authsome-ios

Take a note of the local tunnel URL, which will be need for configuring the sample project.

The development server is now ready and waiting to accept calls from the app. Now, we need to download this repo, configure and run it through Xcode.

Clone the sample project repo

Open a new terminal and create a directory you want to download the sample project. The clone this repo by running the following command:

$ git clone [email protected]:tru-ID/sim-card-auth-ios.git

Configure the project

Now, we need add the local tunnel url you see on the terminal to a configuration file in the project.

Open the project using Xcode

Find the TruIdService-Info.plist

Change the value of the development_server_base_url to the URL provided from the terminal.

...
<key>development_server_base_url</key>
<string>https://spotty-pig-12342.loca.lt</string>
...

Build and Run

Then connect your phone to your computer, navigate to the scheme and select your device as the target device and select "Run". Xcode will build, install and launch your application. Make sure your device's mobile data is enabled (doesn't have to strictly on cellular network when running this app though).

When the application launches, enter the phone number which is associated with the sim card installed in the following format +{country_code}{number} e.g. +447900123456. Tap "Verify my phone number" button and you will see the result of the check.

Tap Next

Observer on the terminal that the calls from the application hits the development server.

Congragulations! You've completed your first tru.ID SubscriberCheck from an iOS application.

Get in touch: please email [email protected] with any questions.

References

Meta

Distributed under the MIT license. See LICENSE for more information.

https://github.com/tru-ID

sim-card-auth-ios's People

Contributors

dxwave avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

vrootebal

sim-card-auth-ios's Issues

Support React Native templates

$ npx react-native init ProjectName --template https://github.com/tru-ID/sim-card-auth-react-native.git\#starter-files

Requires a template.config.js.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.