https://github.com/jakobhellermann/ezoauth
Easy to use OAuth2 client for rust
https://github.com/jakobhellermann/ezoauth
Last synced: 11 months ago
JSON representation
Easy to use OAuth2 client for rust
- Host: GitHub
- URL: https://github.com/jakobhellermann/ezoauth
- Owner: jakobhellermann
- License: mit
- Created: 2020-10-02T12:07:13.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-01-05T09:54:37.000Z (over 4 years ago)
- Last Synced: 2025-05-13T18:56:35.156Z (about 1 year ago)
- Language: Rust
- Size: 9.77 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ezoauth
> An easy to use OAuth2 client for rust
The crate automatically starts a webserver in a background thread and makes the authorization flow a simple matter of calling `ezoauth::authenticate` with your `OAuthConfig`.
## Example Usage
```rust
let config = ezoauth::OAuthConfig {
auth_url: "https://discord.com/api/oauth2/authorize",
token_url: "https://discord.com/api/oauth2/token",
redirect_url: "http://localhost:8000",
client_id: "...",
client_secret: "...",
scopes: vec!["identify"],
};
let (rx, auth_url) = ezoauth::authenticate(config, "localhost:8000")?;
println!("Browse to {}", auth_url);
let token = rx.recv().unwrap()?;
```
#### LICENSE
MIT © [Jakob Hellermann](mailto:jakob.hellermann@protonmail.com)