Crate ones_oidc

Crate ones_oidc 

Source
Expand description

ONES OpenID Connect client for Rust

This library provides authentication with ONES using OpenID Connect (OIDC) and Client Initiated Backchannel Authentication (CIBA).

§Quick Start

use ones_oidc::{OpenIdconnectClient, OnesOidcConfig, load_device_config, read_private_key};
use openidconnect::{core::CoreProviderMetadata, reqwest::async_http_client};

// Load device configuration
let device_config = load_device_config("device_config.yml")?;
let private_key = read_private_key("private_key.pem")?;
 
// Get issuer URL and discover metadata
let issuer_url = device_config.get_issuer_url()?;
let provider_metadata = CoreProviderMetadata::discover_async(
    issuer_url.clone(),
    async_http_client,
).await?;
 
// Create client with configuration
let config = OnesOidcConfig::default()
    .timeout(std::time::Duration::from_secs(10));
     
let client = OpenIdconnectClient::with_config(
    device_config.client_id,
    issuer_url,
    provider_metadata,
    private_key,
    config,
);

Modules§

actions

Structs§

AccessToken
Re-exported types from the openidconnect crate for convenience
ApplicationsWellKnown
AuthenticatedEntity
AuthenticationResult
CibaLoginRequestFrontend
CibaLoginRequestFrontendWithoutResource
CibaStatusRequestFrontend
ClientId
Re-exported types from the openidconnect crate for convenience
DeviceConfig
Device configuration loading utilities
EmptyExtraTokenFields
Re-exported types from the openidconnect crate for convenience
IssuerUrl
Re-exported types from the openidconnect crate for convenience
LoginHint
NewIdentifier
OnesOidcConfig
Configuration for the OIDC client Configuration for the ONES OIDC client
OpenIdconnectClient
Main OIDC client for authentication operations
QrStatusRequest
QrStatusRequestFrontend
RefreshTokenRequestFrontend
StandardTokenResponse
Re-exported types from the openidconnect crate for convenience

Enums§

ApplicationType
AuthRequestResource
AuthenticatedEntityKind
AuthenticationMethod
UserJWT: Best caseUserDevice: only client_id (user mobile), exp, iat, iss, token_typeUserIdp: exp, iat, iss, token_type, scope, sub
CoreTokenType
Re-exported types from the openidconnect crate for convenience
DeviceError
DiscoveryError
IdentifierType
OidcError
UtilsError
WellKnownApplicationsError

Constants§

DEFAULT_DEVICE_CONFIG_PATH
Default path for device configuration file
DEFAULT_PRIVATE_KEY_PATH
Default path for device private key file

Functions§

discover_provider_metadata
OIDC discovery with retry support Discover OIDC provider metadata with retry and exponential backoff.
discover_provider_metadata_from_str
OIDC discovery with retry support Discover OIDC provider metadata from an issuer URL string with retry and exponential backoff.
get_applications_well_known
Get the applications well-known
get_well_known_application_by_client_identifier
Get the application well-known by client identifier
load_device_config
Device configuration loading utilities
read_private_key
Private key utilities Reads and parses a private key file at the given path

Type Aliases§

CoreProviderMetadata
Re-exported types from the openidconnect crate for convenience