Trait graph_oauth::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§
fn code_challenge_method() -> String
sourcefn code_verifier() -> String
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)
fn code_challenge(code_verifier: &String) -> String
sourcefn oneshot() -> Result<ProofKeyCodeExchange, AuthorizationFailure>
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.