Skip to content

tru-ID/sim-based-authentication-flutter-auth0

Repository files navigation

SIM Card Based Authentication with Flutter, Auth0 and tru.ID SubscriberCheck

Note: This repository contains the supporting project for a tutorial found on tru.ID's Developer portal.

Requirements

Getting Started

Clone the starter-files branch via:

git clone -b starter-files --single-branch https://github.com/tru-ID/sim-based-authentication-flutter-auth0.git

If you're only interested in the finished code in main then run:

git clone -b main https://github.com/tru-ID/sim-based-authentication-flutter-auth0.git

Create a tru.ID Account

Install the tru.ID CLI via:

npm i -g @tru_id/cli

Input your tru.ID credentials which can be found within the tru.ID console

Install the tru.ID development server

Create a new tru.ID project within the root directory via:

tru projects:create flutter-auth0 --project-dir .

Run the development server, pointing it to the directory containing the newly created project configuration. This will run a local development server on port 8080

To make the development server publicly accessible on the internet, provide your Ngrok credentials in the .env file of your dev-server

Setting up Auth0

Head over to the Auth0 and sign in. When signed in you'll be redirected to the dashboard as shown below.

Auth0 Dashboard

To create a new application by clicking on the "applications" pane on the left hand side. This will route you to a new page. Click on the "create application" button to create a new application as shown below.

Create application page

This will give you Client ID and Client Secret values which can be found under the settings tab.

created application dashboard page

Next, we need to set up the application callback URL. In the settings page scroll to "Application URIs" and in the "Application callback URL" section enter the following:

com.truid.flutterauth0subscribercheck://login-callback

As shown below:

Application callback URL

Next, we need to copy our the values of the .env.example to .env:

cp .env.example .env

Replace AUTH0_CLIENT_ID with the Client ID value.

Next, replace AUTH0_DOMAIN with the Domain value.

Update AUTH0_ISSUER with the appropriate value.

Run the app

To start the project, ensure you have a physical device connected then run:

flutter run

Note For a physical iOS device ensure you've provisioned your project in XCode

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published