Crate ezoauth[−][src]
Expand description
An easy to use OAuth2 client flow library based on oauth2-rs.
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()?;
Structs
Used to specify how you want to perform your OAuth authentication.
Refresh token used to obtain a new access token (if supported by the authorization server).
Access token scope, as defined by the authorization server.
A token response, which contains the access and refresh token as well as metadata like scopes, expiry info and the token type
Enums
Functions
The authenticate
function performs the OAuth2 flow.