Documentation / v1 / Quickstarts

Rust services

Async OAuth, JWT verification and explicitly bound OTP helpers for Rust applications.

Verify access on the server

Keep issuer and resource audience explicit. The standalone workspace contains beyondigital-auth-sdk and beyondigital-auth-axum; both are MIT licensed.

Rust · rust
use beyondigital_auth_sdk::{create_verifier, OtpClient};

let verifier = create_verifier("https://auth.example.com")
    .with_audience("https://api.example.com");
let user = verifier.verify(&access_token).await?;
if !user.has_scope("documents:read") {
    return Err("Insufficient permission".into());
} // Map this refusal to HTTP 403 in your handler.

let otp = OtpClient::new("https://auth.example.com")
    .with_application("your-app").with_channel("email_otp");
otp.send_login_otp("person@example.com", "your-public-client").await?;

Match the registered client method

Client::revoke identifies the configured client. Public clients use ClientAuthMethod::None; confidential servers select ClientSecretBasic or ClientSecretPost to match registration. Secret-bearing requests refuse redirects. Do not send a confidential secret from a native or desktop app.