pub trait CodeChallengeMethodExt {
// Required method
fn compute_challenge<'a>(
&self,
verifier: &'a str,
) -> Result<Cow<'a, str>, CodeChallengeError>;
// Provided method
fn verify(
&self,
challenge: &str,
verifier: &str,
) -> Result<(), CodeChallengeError>
where Self: Sized { ... }
}
Available on crate feature
experimental-oidc
only.Expand description
Helper trait to compute and verify code challenges.
Required Methods§
Sourcefn compute_challenge<'a>(
&self,
verifier: &'a str,
) -> Result<Cow<'a, str>, CodeChallengeError>
fn compute_challenge<'a>( &self, verifier: &'a str, ) -> Result<Cow<'a, str>, CodeChallengeError>
Compute the challenge for a given verifier
§Errors
Returns an error if the verifier did not adhere to the rules defined by the RFC in terms of length and allowed characters
Provided Methods§
Sourcefn verify(
&self,
challenge: &str,
verifier: &str,
) -> Result<(), CodeChallengeError>where
Self: Sized,
fn verify(
&self,
challenge: &str,
verifier: &str,
) -> Result<(), CodeChallengeError>where
Self: Sized,
Verify that a given verifier is valid for the given challenge
§Errors
Returns an error if the verifier did not match the challenge, or if the verifier did not adhere to the rules defined by the RFC in terms of length and allowed characters