idkollen-client 0.1.0

API client for the IDkollen REST API
Documentation

IDkollen Rust Client

API client for the IDkollen REST API.

Features

  • async (default) — async/await via tokio
  • blocking - synchronous API via reqwest::blocking

Usage

[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(())
}