Skip to main content

DeviceFlowProvider

Trait DeviceFlowProvider 

Source
pub trait DeviceFlowProvider: Send + Sync {
    // Required methods
    fn client_id(&self) -> &str;
    fn device_code_url(&self) -> &str;
    fn access_token_url(&self) -> &str;
    fn scopes(&self) -> &[&str];
    fn validate(&self) -> Result<(), MemoryError>;
}
Expand description

Abstraction over OAuth device authorization grant (RFC 8628) parameters.

Each provider supplies its own client ID, endpoint URLs, and scopes. Implementations must validate their own parameters via validate.

Required Methods§

Source

fn client_id(&self) -> &str

Returns the OAuth client ID for this provider.

Source

fn device_code_url(&self) -> &str

Returns the device code endpoint URL.

Source

fn access_token_url(&self) -> &str

Returns the access token endpoint URL.

Source

fn scopes(&self) -> &[&str]

Returns the list of OAuth scopes to request.

Source

fn validate(&self) -> Result<(), MemoryError>

Validates provider configuration; returns an error if any value is invalid.

Implementors§