| Crates.io | robius-authentication |
| lib.rs | robius-authentication |
| version | 0.1.1 |
| created_at | 2024-06-12 00:11:53.866304+00 |
| updated_at | 2024-11-01 00:22:10.555985+00 |
| description | Rust abstractions for multi-platform native authentication: biometrics, fingerprint, password, TouchID, FaceID, Windows Hello, etc. |
| homepage | https://robius.rs/ |
| repository | https://github.com/project-robius/robius-authentication |
| max_upload_size | |
| id | 1269042 |
| size | 347,292 |
robius-authenticationRust abstractions for multi-platform native authentication.
This crate supports:
USE_BIOMETRIC permission in your app's manifest.polkit-based authentication using the desktop environment's prompt.
For authentication to work, the following must be added to your app's
AndroidManifest.xml:
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
use robius_authentication::{
AndroidText, BiometricStrength, Context, Policy, PolicyBuilder, Text, WindowsText,
};
let policy: Policy = PolicyBuilder::new()
.biometrics(Some(BiometricStrength::Strong))
.password(true)
.watch(true)
.build()
.unwrap();
let text = Text {
android: AndroidText {
title: "Title",
subtitle: None,
description: None,
},
apple: "authenticate",
windows: WindowsText::new("Title", "Description"),
};
let auth_result = Context::new(()).blocking_authenticate(text, &policy);
...
For more details about the prompt text, see the Text struct,
which allows you to customize the prompt for each platform.