
About
Passage by 1Password unlocks the passwordless future with a simpler, more secure passkey authentication experience. Passage handles the complexities of the WebAuthn API, and allows you to implement passkeys with ease.
Use Passkey Flex to add passkeys to an existing authentication experience.
Use Passkey Complete as a standalone passwordless auth solution.
Use Passkey Ready to determine if your users are ready for passkeys.
In passage-flex-rust
Use passage-flex-rust to implement Passkey Flex into your Rust backend to authenticate requests and manage users.
| Product | Compatible |
|---|---|
| ✅ | |
| ✖️ For Passkey Complete, check out the Passkey Complete APIs | |
| ✖️ For Passkey Ready, check out Authentikit |
Getting Started
Check Prerequisites
Install
cargo add passage_flex
Import
use PassageFlex;
Initialize
let passage_flex = new;
Go Passwordless
Find more details about Passkey Flex on our Passkey Flex Documentation and Docs.rs pages.
API Reference
Retrieve App Info
To retrieve information about the app, use the get_app method.
use PassageFlex;
let passage_flex = new;
let app_info = passage_flex.get_app.await.unwrap;
println!;
Create a Registration Transaction
To create a transaction to start a user passkey registration, use the create_register_transaction method.
use PassageFlex;
let passage_flex = new;
let external_id = "a unique immutable string that represents your user".to_string;
let passkey_display_name =
"the label for the user's passkey that they will see when logging in".to_string;
let transaction = passage_flex
.create_register_transaction
.await
.unwrap;
Create an Authentication Transaction
To create a transaction to start a user passkey authentication, use the create_authenticate_transaction method.
use PassageFlex;
let passage_flex = new;
let external_id = "a unique immutable string that represents your user".to_string;
let transaction = passage_flex
.create_authenticate_transaction
.await
.unwrap;
Verify a Nonce
To verify a nonce that you received from the end of of passkey registration or authentication ceremony, use the verify_nonce method.
use PassageFlex;
let passage_flex = new;
let nonce =
"a unique single-use value received from the client after a passkey ceremony".to_string;
match passage_flex.verify_nonce.await
Retrieve User Info
To retrieve information about a user by their external ID -- which is the unique, immutable ID you supply to associate the Passage user with your user -- use the get_user method.
use PassageFlex;
let passage_flex = new;
// this is the same value used when creating a transaction
let external_id = your_user.id;
// get user info
let user_info = passage_flex.get_user.await.unwrap;
println!;
Retrieve a user's passkey devices
To retrieve information about a user's passkey devices, use the get_devices method.
use PassageFlex;
let passage_flex = new;
// this is the same value used when creating a transaction
let external_id = your_user.id;
// get devices
let passkey_devices = passage_flex.get_devices.await.unwrap;
for device in passkey_devices
Revoke a User's Passkey Device
To revoke a user's passkey device, use the revoke_device method.
use PassageFlex;
use ;
let passage_flex = new;
// this is the same value used when creating a transaction
let external_id = your_user.id;
let last_year = now.naive_utc.date - days;
// get devices
let passkey_devices = passage_flex.get_devices.await.unwrap;
for device in passkey_devices
Support & Feedback
We are here to help! Find additional docs, the best ways to get in touch with our team, and more within our support resources.