Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,14 @@ pub struct PkceCodeChallenge {
code_challenge_method: PkceCodeChallengeMethod,
}
impl PkceCodeChallenge {
/// Create a new PkceCodeChallenge to wrap the given String challenge and method
pub fn new(code_challenge: String, code_challenge_method: PkceCodeChallengeMethod) -> Self {
PkceCodeChallenge {
code_challenge,
code_challenge_method,
}
}

/// Generate a new random, base64-encoded SHA-256 PKCE code.
pub fn new_random_sha256() -> (Self, PkceCodeVerifier) {
Self::new_random_sha256_len(32)
Expand Down