Skip to main content

API Reference - Flutter

Create an SDK Instance

// import sdk
import 'package:flutterpluginfidologinapi/flutterpluginfidologinapi.dart';
// ...
// ...
// example app
class _MyAppState extends State<MyApp> {


void initState() {
super.initState();
initializeState();
}

// Fido login api plugin are asynchronous, so we initialize in an async method.
Future<void> initializeState() async {
String clientId = "032690b3-9bc4-4602-87c1-60c1fae782f2";
String baseURL = "https://060ce487-b934-43d0-a925-b66e80c7532f.{{brand_native_api}}";
await FPLoginApi.configure(clientId,baseURL);

// ...
// ...
}
// ...
// ...
}

registerWithFido2

Sign up a user for FIDO authentication.

static Future<RegisterResponse> registerWithFido2(String username, RegistrationOptions options) async

Where:

class RegistrationOptions {
String authToken;
}
ParameterTypeRequiredDetails
usernamestringtrueUsername of the customer to be registered.
optionsRegistrationOptionsoptionalAPI Service token (JWT) signed by your Private Key, as per the API Credential added to the integration.

registerWithPassword

Creates a user account with a password (not recommended). If leveraging this method, users should be migrating to use a FIDO authenticator, then have their password revoked.

static Future<RegisterResponse> registerWithPassword(String username, String password, String confirmationPassword, RegistrationOptions options) async 

Where:

class RegistrationOptions {
String authToken;
}
ParameterTypeRequiredDetails
usernamestringtrueUsername of the customer to be registered.
passwordstringtruePassword of the customer to be registered.
passwordConfirmationstringtrueIt is best practice to have the customer enter their password twice before creating their profile to prevent typos. If desired, you could only require the end user to enter their password once and pass that password in both fields.
optionsRegistrationOptionsoptionalAPI Service token (JWT) signed by your Private Key, as per the API Credential added to the integration.

authenticateWithFido2

Authenticate a previously registered user through FIDO2.

static Future<AuthenticateResponse> authenticateWithFido2(String username, AuthenticationOptions options) async

Where:

class AuthenticationOptions {
String authToken;
}
ParameterTypeRequiredDetails
usernamestringtrueUsername of the customer to be registered.
optionsAuthenticationOptionsoptionalAPI Service token (JWT) signed by your Private Key, as per the API Credential added to the integration.

authenticateWithPassword

Authenticate a previously registered user using username and password.

static Future<AuthenticateResponse> authenticateWithPassword(String username, String password, AuthenticationOptions options) async 

Where:

class AuthenticationOptions {
String authToken;
}
ParameterTypeRequiredDetails
usernamestringtrueUsername of the customer to be authenticated.
passwordstringtruePassword of the customer to be authenticated.
optionsAuthenticationOptionsoptionalAPI Service token (JWT) signed by your Private Key, as per the API Credential added to the integration.

confirmTransaction

Confirm the transaction of a text-based payload using registered Fido2 account.

static Future<TransactionResponse> transactionConfirmation(String username, TransactionPayload payload, TransactionOptions options) async 

Where:

class TransactionPayload {
String nonce;
String data;
}

class TransactionOptions {
String authToken;
}
ParameterTypeRequiredDetails
usernamestringtrueUsername of the customer to be authenticated.
payloadTransactionPayloadtrueRequire a client side generated nonce value and a text message to display back to user for confirmation.
optionsAuthenticationOptionsoptionalAPI Service token (JWT) signed by your Private Key, as per the API Credential added to the integration.

isLoggedIn

Check if a given user is currently logged in.

logout