# 👤 oauth-lib
Asynchronous Rust library to deal with OAuth flows.
## Features
- Implements the ***OAuth 2.0** Authorization Code Grant* flow from [RFC6749](https://datatracker.ietf.org/doc/html/rfc6749#section-4.1)
- Implements the ***OAuth 2.0** Refresh Access Token* flow from [RFC6749](https://datatracker.ietf.org/doc/html/rfc6749#section-6)
- Supports **tokio** and **async-std** async runtimes
- Supports **rustls** and **native-tls** crypto libs
The library comes with 5 [cargo features](https://doc.rust-lang.org/cargo/reference/features.html), including 2 default ones:
- **`tokio`**: enables the [tokio](https://crates.io/crates/tokio) async runtime
- `async-std`: enables the [async-std](https://crates.io/crates/async-std) async runtime
- **`rustls`**: enables the [rustls](https://crates.io/crates/rustls) crypto
- `native-tls`: enables the [native-tls](https://crates.io/crates/native-tls) crypto
- `vendored`: compiles and statically link to a copy of non-Rust vendors like OpenSSL
## Examples
Examples can be found at [`./examples`](https://github.com/pimalaya/core/tree/master/oauth/examples):
```sh
cargo run --example
```
*See the full API documentation on [docs.rs](https://docs.rs/oauth-lib/latest/oauth/).*
## Sponsoring
[](https://nlnet.nl/)
Special thanks to the [NLnet foundation](https://nlnet.nl/) and the [European Commission](https://www.ngi.eu/) that helped the project to receive financial support from various programs:
- [NGI Assure](https://nlnet.nl/project/Himalaya/) in 2022
- [NGI Zero Entrust](https://nlnet.nl/project/Pimalaya/) in 2023
- [NGI Zero Core](https://nlnet.nl/project/Pimalaya-PIM/) in 2024 *(still ongoing)*
If you appreciate the project, feel free to donate using one of the following providers:
[](https://github.com/sponsors/soywod)
[](https://ko-fi.com/soywod)
[](https://www.buymeacoffee.com/soywod)
[](https://liberapay.com/soywod)
[](https://thanks.dev/soywod)
[](https://www.paypal.com/paypalme/soywod)