Flutter package for Multi Factor Authentication.

Related tags

Templates rrad_mfa
Overview

RRAD Multi Factor Authentication

Features

  • Register Device for Time based OTP.
  • Verify registration of Time based OTP.
  • Validate Time based for registered devices with userId.
  • Send sms OTP.
  • Validate sms OTP.

Installation

Add the package to your pubspec.yaml

dependencies:
  rrad_mfa: any

Then you have to initialize the package instance to use it.

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  RRADMFA.instance.init(
    appName: 'RRAD', // Short name of your app
    serverUrl: 'http://localhost:6969', // Your server url
    totpApiKey: 'sdvsdvdaszfhvcedsth',   // Your api key for totp
    smsApiKey: 'adsrgetwyetr',   // Your api key for sms otp
  );

  runApp(const MyApp());
}
  • If you want to use Time based OTP totpApiKey is required.
  • If you want to use SMS based OTP smsApiKey is required.

API Specifications

Register userId for the first time in Time based OTP
TOTPResponse<TOTP?> result = await RRADMFA.instance.register();

If the registration is successfull it will return secrets, userId and image Unit8List data for qrcode. Use data to show image with Image.memory widget.

Image.memory(
    result.qrcodeImage!,
);
Verify time based Otp for userId after
TOTPResponse<TOTP?> result = await RRADMFA.instance.verify(
    userId: '', // userId stored from register response
    otp: '',  // otp taken from user
);
Validate Time based Otp for userId
TOTPResponse<TOTP?> result = await RRADMFA.instance.validate(
    userId: '', // userId stored from register response
    otp: '',  // otp taken from user
);
Send Sms Otp to phone number

We are only sending sms otp to valid bangladeshi phone number for the time being.

TOTPResponse<TOTP?> result = await RRADMFA.instance.sendSmsOtp(
    phoneNumber: '', // phone number of user
);
Validate Sms Otp sent to phone number
TOTPResponse<TOTP?> result = await RRADMFA.instance.validateSmsOtp(
    phoneNumber: '', // phone number of user
    otp: '',  // otp taken from user
);

Created with ❤️ by RRAD

You might also like...

Multi Translator build with Flutter, It developed with DDD (Domain Driven Design) principles.

Multi Translator build with Flutter, It developed with DDD (Domain Driven Design) principles.

Multi Translator App An app utilizes to translate any text to multiple languages. Features Localization Multiple Translation Single Translation Deep L

Dec 27, 2022

A modern multi vendor shop app using Flutter and Firestore

A modern multi vendor shop app using Flutter and Firestore. This app have absolutely everything a multivendor shopping app should have. Screens are on screenshots folder

Dec 24, 2022

A multi purpose Bitcoin wallet

A multi purpose Bitcoin wallet

STACKMATE A multi-purpose Bitcoin Wallet Table of Contents Core Features Getting Started Flutter Development VSCode Explorer Exchange Rates API Updati

Jan 11, 2022

Tic Tac Toe game with single-player and multi-player options. Implemented minimax algorithm.

flutter_tic_tac_toe A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Jan 1, 2022

Helper for building advanced multi child layouts.

Helper for building advanced multi child layouts.

About Boxy is designed to overcome the limitations of Flutter's built-in layout widgets, it provides utilities for flex, custom multi-child layouts, d

Dec 12, 2022

A multi-purpose Bitcoin Wallet

A multi-purpose Bitcoin Wallet

A multi-purpose Bitcoin Wallet

Dec 14, 2022

Multi-platform application to practice quizzes from the course Operations Research M.

Multi-platform application to practice quizzes from the course Operations Research M.

Dec 26, 2022

Free and open source multi-platform novel reader.

Nacht Free and open source multi-platform novel reader.

Dec 29, 2022

Learn how to build a multi-step form flow and how to use bloc to effectively isolate the presentation layer from the business logic layer.

Learn how to build a multi-step form flow and how to use bloc to effectively isolate the presentation layer from the business logic layer.

Multi-page Form Flow Learn how to build a multi-step form flow and how to use bloc to effectively isolate the presentation layer from the business log

Dec 19, 2022
Owner
Robust Research and Development
Simple solution for your complex problems.
Robust Research and Development
vncitizens app :: authentication package

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Hữu 2 Nov 28, 2022
Flutter Multi-platform allows developers to unleash their app to run on the wide variety of different platforms with little or no change.

Flutter Multi-platform sample Flutter Multi-platform allows developers to unleash their app to run on the wide variety of different platforms with lit

MindInventory 22 Dec 31, 2022
Multi-language support in Flutter without using any third-party library

flutter_localization_app A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get

Gulshan Yadav 1 Oct 30, 2021
Custom calendar dialog widget for flutter with (multi select, single select, date range) mode

some calendar Custom calendar with Multi-select & range configurable calendar New Features Added View Mode Somecalendar #15 Help Maintenance I've take

Irvan Lutfi Gunawan 69 Jan 3, 2023
Flutter plugin, support android/ios.Support crop, flip, rotate, color martix, mix image, add text. merge multi images.

image_editor The version of readme pub and github may be inconsistent, please refer to github. Use native(objc,kotlin) code to handle image data, it i

FlutterCandies 317 Jan 3, 2023
Multi-Camera-Dashboard - Flutter App to View RTSP Streams

9.9.2021 update I have updated the firebase db to be read only due to abuse. The save operation works if you import your own firebase and modify proje

Mitch Ross 54 Jan 1, 2023
Multi type list view - A flutter customer ListView that displays multiple widget types.

MultiTypeListView A light weight flutter customer ListView that displays multiple widget types. Screenshot home chat Getting Started dependencies: m

齐翊(学义) 52 Jun 28, 2022
A collection of Flutter Widgets that make multi screen user experiences easy to build

Multi Screen Layout for Flutter A collection of Widgets that make multi screen user experiences easy to build Supported Devices Surface Duo Surface Du

Jason Rai 75 Dec 1, 2022
An EMI calculator multi-platform app using Flutter

emi_calc_app An EMI calculator multi-platform app using Flutter. How to run the App Fork or download the project and extract it. Open Terminal / CMD a

SAHIL PAL 1 Nov 8, 2022
This is an application that uses the Flutter framework, SQFLite as a database to record blood pressure, blood sugar, BMI, or create medication reminders in multi mobile platforms You can run this project on iOS, Android

This is an application that uses the Flutter framework, SQFLite as a database to record blood pressure, blood sugar, BMI, or create medication reminders in multi mobile platforms You can run this project on iOS, Android

null 14 Dec 29, 2022