PKCE (RFC 7636) code verifiers and challenges.
ATProto OAuth requires the S256 challenge method: the verifier never travels
over the wire, and the authorization server only ever sees
BASE64URL(SHA256(verifier)).
Summary
Functions
Compute the S256 code challenge for a verifier.
Generate a random code verifier.
Check that a verifier is syntactically valid per RFC 7636: 43–128
characters from the unreserved set ALPHA / DIGIT / "-" / "." / "_" / "~".
Functions
Compute the S256 code challenge for a verifier.
@spec generate_verifier() :: String.t()
Generate a random code verifier.
Returns 43 unreserved characters (BASE64URL of 32 random bytes, no
padding), the minimum length allowed by RFC 7636.
Check that a verifier is syntactically valid per RFC 7636: 43–128
characters from the unreserved set ALPHA / DIGIT / "-" / "." / "_" / "~".