ezoauth

Crates.ioezoauth
lib.rsezoauth
version0.2.0
sourcesrc
created_at2020-10-02 12:36:22.037218
updated_at2022-01-05 09:55:40.825802
descriptionEasy to use OAuth2 client for rust
homepage
repositoryhttps://github.com/jakobhellermann/ezoauth
max_upload_size
id295339
size37,693
Jakob Hellermann (jakobhellermann)

documentation

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

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

Commit count: 11

cargo fmt