3 unstable releases
0.2.0 | Feb 26, 2023 |
---|---|
0.1.1 | Jan 14, 2021 |
0.1.0 | Jul 13, 2020 |
#449 in Authentication
8,379 downloads per month
Used in 7 crates
5KB
pkce-rs
A very simple library for generating code verifiers and challenges to use for OAuth Proof Key for Code Exchange. It is not rocket science.
extern crate pkce;
fn main() {
// Generate a random 128-byte code verifier (must be between 43 and 128 bytes)
let code_verify = pkce::code_verifier(128);
// Generate an encrypted code challenge accordingly
let code_challenge = pkce::code_challenge(&code_verify);
println!("Code challenge generated: {}", code_challenge);
}
Wow, it really is that simple.
Features
In order to support WebAssembly enable feature js
.
lib.rs
:
This is a minimal library with functions to generate random code verifiers and challenges to be used for OAuth Proof Key for Code Exchange.
extern crate pkce;
fn main() {
let code_verify = pkce::code_verifier(128);
let code_challenge = pkce::code_challenge(&code_verify);
println!("Code challenge generated: {}", code_challenge);
}
Dependencies
~0.8–1.4MB
~26K SLoC