Trait GenPkce

Source
pub trait GenPkce {
    // Provided methods
    fn code_challenge_method() -> String { ... }
    fn code_verifier() -> String { ... }
    fn code_challenge(code_verifier: &String) -> String { ... }
    fn oneshot() -> Result<ProofKeyCodeExchange, AuthorizationFailure> { ... }
}

Provided Methods§

Source

fn code_challenge_method() -> String

Source

fn code_verifier() -> String

Known as code_verifier in proof key for code exchange Uses the Rust ring crypto library to generate a secure random 32-octet sequence that is base64 URL encoded (no padding)

Source

fn code_challenge(code_verifier: &String) -> String

Source

fn oneshot() -> Result<ProofKeyCodeExchange, AuthorizationFailure>

Generate a code challenge and code verifier for the authorization code grant flow using proof key for code exchange (PKCE) and SHA256.

ProofKeyCodeExchange contains a code_verifier, code_challenge, and code_challenge_method for use in the authorization code grant.

For authorization, the code_challenge_method parameter in the request body is automatically set to ‘S256’.

Internally this method uses the Rust ring cyrpto library to generate a secure random 32-octet sequence that is base64 URL encoded (no padding) and known as the code verifier. This sequence is hashed using SHA256 and base64 URL encoded (no padding) resulting in a 43-octet URL safe string which is known as the code challenge.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§