Small, dependency-free cryptographic helpers used by the OAuth2 flow: CSRF state token generation and constant-time comparison.
Summary
Functions
Compares two strings in constant time, for safely comparing a returned
OAuth state value against the one you generated.
Returns a cryptographically random, URL-safe string suitable for use as
the OAuth2 state parameter to protect against CSRF.
Functions
Compares two strings in constant time, for safely comparing a returned
OAuth state value against the one you generated.
@spec generate_state(pos_integer()) :: String.t()
Returns a cryptographically random, URL-safe string suitable for use as
the OAuth2 state parameter to protect against CSRF.