Skip to main content

pkce_pair

Function pkce_pair 

Source
pub fn pkce_pair() -> (String, String)
Expand description

Generate a random PKCE verifier and matching S256 code challenge (RFC 7636 §4.1, §4.2).

The verifier is 32 bytes of CSPRNG output encoded as base64url-no-pad, landing at 43 ASCII characters — within the RFC’s 43..=128 range. The challenge is BASE64URL-NO-PAD(SHA256(verifier)).