Skip to content

tru-ID/passwordless-auth-react-native

Repository files navigation

Passwordless Mobile Authentication and SIM SWap Detection with React Native

Requirements

  • An Android / Apple Phone with a SIM card and mobile data connection
  • For iOS: Require XCode >12
  • For Android:
  • For metro bundler, require node version > 10

Getting Started

Clone the starter-files branch via:

git clone -b starter-files --single-branch https://github.com/tru-ID/passwordless-auth-react-native

To restore dependencies, open a new terminal and run:

npm install

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 CLI development server plugin

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

tru projects:create rn-auth

Run the development server, pointing it to the directly containing the newly created project configuration. This will also open up a localtunnel to your development server making it publicly accessible to the Internet so that your mobile phone can access it when only connected to mobile data.

tru server -t --project-dir ./rn-auth

Starting Project

To start the project, ensure you have a physical device connected (see Running React Native on a physical device guide ) then run:

npm run android
#or
npm run ios

Troubleshooting

While trying to run on Android, you might run into Could not find or load main class org.gradle.wrapper.GradleWrapperMain error. To resolve it:

  • Install Gradle
  • Navigate to the Android directory and run gradle wrapper
  • Run npm run android

References

Meta

Distributed under the MIT License. See LICENSE

tru.ID

About

Passwordless Mobile Authentication and SIM Swap Detection Example for React Native

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5