[][src]Crate twitch_oauth2

githubcrates-iodocs-rs


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

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

Re-exports

pub use oauth2::AccessToken;
pub use oauth2::ClientId;
pub use oauth2::ClientSecret;
pub use oauth2::RefreshToken;

Modules

client

Provides different http clients

id

Representation of oauth2 flow in id.twitch.tv

scopes

Module for all possible scopes in twitch.

tokens

Twitch token types

Structs

AppAccessToken

An App Access Token from the OAuth client credentials flow

UserToken

An User Token from the OAuth implicit code flow or OAuth authorization code flow

ValidatedToken

Token validation returned from https://id.twitch.tv/oauth2/validate

Enums

Scope

Scopes for twitch.

Traits

TwitchToken

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

Functions

refresh_token

Refresh the token, call if it has expired.

revoke_token

Revoke the token.

validate_token

Validate this token.