Crate twitch_oauth2[][src]

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 oauth2::AccessToken;
pub use oauth2::AuthorizationCode;
pub use oauth2::ClientId;
pub use oauth2::ClientSecret;
pub use oauth2::CsrfToken;
pub use oauth2::RedirectUrl;
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.

Statics

AUTH_URL

Authorization URL for id.twitch.tv

REVOKE_URL

Revokation URL for id.twitch.tv

TOKEN_URL

Token URL for id.twitch.tv

VALIDATE_URL

Validation URL for id.twitch.tv

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.