PingOne Recognize

PIN Authentication

For authentication scenarios that do not require biometric recognition, you can use PIN as an alternative.

PIN authentication has limited capabilities compared to biometric authentication. PIN supports operation info and JWT signing.

PingOne Recognize requires at least one of the following authentication factors to be present for each user:

  • biometric factor

  • PIN factor

PIN factor can be any valid String. Numbers are not enforced but are recommended because numeric PINs are familiar for end users.

Enrollment with PIN

To enroll using the PIN factor, create one of the following configurations.

Android

val configuration = PinEnrollConfig(pin = "1234")

Keyless.enroll(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS

let configuration = PinEnrollConfig(pin: "1234")

Keyless.enroll(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Android 4.6

val configuration = EnrollmentConfiguration.builder
  .withPin("1234")
  .build()

Keyless.enroll(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS 4.6

let configuration = Keyless.EnrollmentConfiguration.builder
  .withPin("1234")
  .build()

Keyless.enroll(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Flutter

final configuration = PinEnrollConfig(
  pin: "myPin",
);

try {
  await Keyless.instance.enroll(configuration);
  print("Enrollment successful");
} catch (error) {
  print("Enrollment failed: $error");
}

React Native

const config = new PinEnrollConfig({
  pin: '1234',
});

const result = await Keyless.enroll(config);
result.fold({
  onSuccess(data) {
    logConsole('Auth result success ' + JSON.stringify(data, null, 2));
  },
  onFailure(error) {
    logConsole('Enroll result failure ' + JSON.stringify(error, null, 2));
  },
});

To enroll multiple authentication factors, call PingOne Recognize.enroll once for each factor.

Authentication with PIN

To authenticate using the PIN factor, create one of the following configurations.

Android

val configuration = PinAuthConfig(pin = "1234")

Keyless.authenticate(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS

let configuration = PinAuthConfig(pin: "1234")

Keyless.authenticate(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Android 4.6

val configuration = AuthenticationConfiguration.builder
  .withPin("1234")
  .build()

Keyless.authenticate(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS 4.6

let configuration = Keyless.AuthenticationConfiguration.builder
  .withPin("1234")
  .build()

Keyless.authenticate(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Flutter

final configuration = PinAuthConfig(
  pin: "1234",
);

try {
  final result = await Keyless.instance.authenticate(configuration);
  print("Authentication successful");
} catch (error) {
  print("Authentication failed: $error");
}

React Native

const config = new PinAuthConfig({
  pin: '1234',
});

const result = await Keyless.authenticate(config);
result.fold({
  onSuccess(data) {
    logConsole('Auth result success ' + JSON.stringify(data, null, 2));
  },
  onFailure(error) {
    logConsole('Auth result failure ' + JSON.stringify(error, null, 2));
  },
});

De-enrollment with PIN

De-enrolling deletes both biometric and PIN factors. To remove only the PIN factor, use PIN utilities.

To de-enroll using the PIN authentication factor, create one of the following configurations.

Android

val configuration = PinDeEnrollConfig(pin = "1234")

Keyless.deEnroll(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS

let configuration = PinDeEnrollConfig(pin: "1234")

Keyless.deEnroll(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Android 4.6

val configuration = DeEnrollmentConfiguration.builder
  .withPin("myPin")
  .build()

Keyless.deEnroll(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS 4.6

let configuration = Keyless.DeEnrollmentConfiguration.builder
  .withPin("myPin")
  .build()

Keyless.deEnroll(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Flutter

final configuration = PinDeEnrollConfig(
  pin: "1234",
);

try {
  await Keyless.instance.deEnroll(configuration);
  print("De-enrollment successful");
} catch (error) {
  print("De-enrollment failed: $error");
}

React Native

const config = new PinDeEnrollConfig('1234');

const result = await Keyless.deEnroll(config);
result.fold({
  onSuccess(data) {
    logConsole('DeEnroll result success ' + JSON.stringify(data, null, 2));
  },
  onFailure(error) {
    logConsole('DeEnroll result failure ' + JSON.stringify(error, null, 2));
  },
});

Remove PIN (Keep Biometric Factor)

To remove the PIN factor while keeping biometric authentication, perform biometric authentication with shouldRemovePin = true.

Android

val configuration = BiomAuthConfig(shouldRemovePin = true)

Keyless.authenticate(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS

let configuration = BiomAuthConfig(shouldRemovePin: true)

Keyless.authenticate(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Android 4.6

val configuration = AuthenticationConfiguration.builder
  .removingPin()
  .build()

Keyless.authenticate(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS 4.6

let configuration = Keyless.AuthenticationConfiguration.builder
  .removingPin()
  .build()

Keyless.authenticate(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Flutter

final configuration = BiomAuthConfig(
  shouldRemovePin: true,
);

try {
  await Keyless.instance.authenticate(configuration);
  print("Pin remove successful");
} catch (error) {
  print("Pin remove failed: $error");
}

React Native

const config = new BiomAuthConfig({
  shouldRemovePin: true,
});

const result = await Keyless.deEnroll(config);
result.fold({
  onSuccess(data) {
    logConsole('Auth result success ' + JSON.stringify(data, null, 2));
  },
  onFailure(error) {
    logConsole('Auth result failure ' + JSON.stringify(error, null, 2));
  },
});

PIN Utilities

To change the PIN, use newPin in PinAuthConfig.

Android

val configuration = PinAuthConfig(pin = "1234", newPin = "5678")

Keyless.authenticate(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS

let configuration = PinAuthConfig(pin: "1234", newPin: "5678")

Keyless.authenticate(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Flutter

Future<void> changePin({
  required String oldPin,
  required String newPin
}) async

React Native

const config = new PinAuthConfig({
  pin: '1234',
  newPin: '5678',
});

const result = await Keyless.authenticate(config);
result.fold({
  onSuccess(data) {
    logConsole('Auth result success ' + JSON.stringify(data, null, 2));
  },
  onFailure(error) {
    logConsole('Auth result failure ' + JSON.stringify(error, null, 2));
  },
});

To remove the PIN factor and keep biometric enrollment, use shouldRemovePin in PinAuthConfig.

Android

val configuration = PinAuthConfig(pin = "1234", shouldRemovePin = true)

Keyless.authenticate(
  configuration = configuration,
  onCompletion = { /* TODO: process result */ }
)

iOS

let configuration = PinAuthConfig(pin: "1234", shouldRemovePin: true)

Keyless.authenticate(
  configuration: configuration,
  onCompletion = { /* TODO: process result */ }
)

Flutter

Future<void> removePin({
  required String pin
}) async

React Native

const config = new PinAuthConfig({
  pin: '1234',
  shouldRemovePin: true,
});

const result = await Keyless.authenticate(config);
result.fold({
  onSuccess(data) {
    logConsole('Auth result success ' + JSON.stringify(data, null, 2));
  },
  onFailure(error) {
    logConsole('Auth result failure ' + JSON.stringify(error, null, 2));
  },
});