[][src]Crate twitch_oauth2

githubcrates-iodocs-rs


OAuth2 for Twitch endpoints
This example is not tested
    use twitch_oauth2::TwitchToken;
    let user_token = UserToken::from_existing("sometokenherewhichisvalidornot").await.unwrap();
    println!("user_token: {}", user_token.token().secret())

Structs

AppAccessToken

An App Access Token from the OAuth client credentials flow

TwitchTokenResponse

Twitch's representation of the oauth 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

RefreshTokenError

Errors for TwitchToken::refresh_token

RevokeTokenError

Errors for revoke_token

Scope

Scopes for twitch.

TokenError

Errors for AppAccessToken::get_app_access_token

ValidationError

Errors for validate_token

Traits

TwitchToken

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

Functions

revoke_token

Revoke the token, uses [https://dev.twitch.tv/docs/authentication#revoking-access-tokens]

validate_token

Validate this token. Should be checked repeatedly.

Type Definitions

TwitchClient

Client for Twitch OAuth2