ic-auth-client-rs
Port of @dfinity/auth-client for the Rust programming language.
Installation
Add the following to your Cargo.toml:
[]
= "0.1"
In the browser:
use AuthClient;
To get started with auth client, run
let mut auth_client = builder
// any configurations
.build
.await;
The auth_client can log in with
use AuthClientLoginOptions;
let options = builder
.max_time_to_live
.on_success
.build;
auth_client.login_with_options;
It opens an identity.ic0.app window, saves your delegation to localStorage, and then sets you up with an identity.
Then, you can use that identity to make authenticated calls using the ic-agent::Agent.
let identity = auth_client.identity;
let agent = builder
.with_url
.with_identity
.build?;