# Rusty-Oauth


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](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgements](#acknowledgements)
## Features
- Gain Control over the authorization.
- Build for developer seeking for low level oauth.
- Built in Tls config : So no need to worry about breach of security.
- HTTP/2 & HTTP/3 Support: Extending the potential of oauth control over the properties.
- Asynchronous | Syncronous : Non-blocking parsing for better performance.
## Installation
To include this crate in your project, add the following line to your `Cargo.toml`:
```toml
[dependencies]
rusty_oauth = "0.1.1"
```
```toml
let secret = ClientSecret::new("").unwrap();
let client_id = ClientId::new("").unwrap();
let redirect = ClientProviderUrl::new(rusty_oauth::Providers::GOOGLE);
let client_token_url = ClientTokenUrl::new(rusty_oauth::Providers::GOOGLE);
let email = Scope::UserScope(rusty_oauth::scope::scope::UserScope::Email);
let profile = Scope::UserScope(rusty_oauth::scope::scope::UserScope::Profile);
let email = handle_scope(email);
let profile = handle_scope(profile);
let scope = handle_scope_store(&[email, profile]);
let code_verifier = Code::code_verifier();
let code_challenge = Code::code_challenge(&code_verifier);
println!("{}", code_challenge);
println!("init {:?}", code_verifier.code_challenge());
let client = Client::new(
&client_id,
&secret,
&redirect,
&client_token_url,
scope,
code_verifier.clone(),
code_challenge,
);
# generate authorization code
let code = client.handle_authorization_code(path).access_token.unwrap();
# generate exchange code
let code = client.exchange_code(code).unwrap();
let mut token: GoogleOauthExchange;
if !code.contains("invalid_grant") {
let detai = decode_token(code);
println!("{:?}", detai);
}
```
# Acknowledgements
This project was created and maintained by Me, To give the ability to developer to gain control over oauth
Special thanks to all contributors and the open-source community for their invaluable support, feedback, and contributions. Together, we continue to push the boundaries of what's possible