IDkollen Rust Client
API client for the IDkollen REST API.
Features
async(default) — async/await viatokioblocking- synchronous API viareqwest::blocking
Usage
[]
= { = "0.1", = ["async"] }
use ;
use ;
async
API client for the IDkollen REST API.
async (default) — async/await via tokioblocking - synchronous API via reqwest::blocking[dependencies]
idkollen-client = { version = "0.1", features = ["async"] }
use idkollen_client::{IdkollenClientBuilder, Environment};
use idkollen_client::models::{BankIdSeAuthRequest, PollOptions};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = IdkollenClientBuilder::new("client_id", "client_secret")
.environment(Environment::Staging)
.build()?;
let session = client
.bankid_se()
.auth(BankIdSeAuthRequest::new())
.await?;
let result = client
.bankid_se()
.wait_for_auth(&session.id(), PollOptions::default())
.await?;
println!("{result:#?}");
Ok(())
}