Crate twitch_oauth2

source ·
Expand description

githubcrates-iodocs-rs


OAuth2 for Twitch endpoints
    let token = AccessToken::new("sometokenherewhichisvalidornot".to_string());

    match UserToken::from_existing(&reqwest_http_client, token, None, None).await {
        Ok(t) => println!("user_token: {}", t.token().secret()),
        Err(e) => panic!("got error: {}", e),
    }

Re-exports

pub use url;
pub use types::AccessToken;
pub use types::ClientId;
pub use types::ClientSecret;
pub use types::CsrfToken;
pub use types::RefreshToken;

Modules

Provides different http clients
Representation of oauth2 flow in id.twitch.tv
Module for all possible scopes in twitch.
Twitch token types
Types used in OAUTH2 flow.

Structs

An App Access Token from the OAuth client credentials flow
Token validation returned from https://id.twitch.tv/oauth2/validate

Enums

Errors from parsing responses
Scopes for twitch.

Statics

Authorization URL (https://id.twitch.tv/oauth2/authorize) for id.twitch.tv
Revokation URL (https://id.twitch.tv/oauth2/revoke) for id.twitch.tv
Token URL (https://id.twitch.tv/oauth2/token) for id.twitch.tv
Validation URL (https://id.twitch.tv/oauth2/validate) for id.twitch.tv

Traits

Trait for twitch tokens to get fields and generalize over AppAccessToken and UserToken