rusty_oauth-0.1.1 has been yanked.
HTTP-SCRAPE
rusty-oauth is a simple, lightweight, and efficient Rust crate that facilitates OAuth 2.0 authentication with popular service providers such as Google, GitHub, Facebook, and more. This crate provides an easy-to-use interface to handle the OAuth authorization flow, manage tokens, and interact with user data through RESTful APIs. Designed to be minimal yet powerful, OAuth-Rust helps developers integrate secure authentication into their Rust application
Table of Contents
Features
- HTTP/2 & HTTP/3 Support: Extending the parser for modern HTTP protocols.
- Asynchronous Parsing | Syncronous Parsing: Non-blocking parsing for better performance.
- Header Parsing: Extract individual headers for enhanced request handling
Installation
To include this crate in your project, add the following line to your Cargo.toml
:
[]
= "0.1.1"
= ClientSecret::new("").unwrap();
= ClientId::new("").unwrap();
= ClientProviderUrl::new(rusty_oauth::Providers::GOOGLE);
= ClientTokenUrl::new(rusty_oauth::Providers::GOOGLE);
= Scope::UserScope(rusty_oauth::scope::scope::UserScope::Email);
= Scope::UserScope(rusty_oauth::scope::scope::UserScope::Profile);
= handle_scope(email);
= handle_scope(profile);
= handle_scope_store(&[email, profile]);
= Code::code_verifier();
= Code::code_challenge(&code_verifier);
"{}", code_challenge);
"init {:?}", code_verifier.code_challenge());
= Client::new(
&client_id,
&secret,
&redirect,
&client_token_url,
,
);
# generate authorization code
= client.handle_authorization_code(path).access_token.unwrap();
# generate exchange code
= client.exchange_code(code).unwrap();
GoogleOauthExchange;
code.contains("invalid_grant") {
= decode_token(code);
"{:?}", detai);
}