[−][src]Crate twitch_oauth2
OAuth2 for Twitch endpoints
use twitch_oauth2::TwitchToken; let user_token = UserToken::from_existing("sometokenherewhichisvalidornot").await.unwrap(); println!("user_token: {}", user_token.token().secret())
Structs
AccessToken | Access token returned by the token endpoint and used to access protected resources. |
AppAccessToken | An App Access Token from the OAuth client credentials flow |
ClientId | Client identifier issued to the client during the registration process described by Section 2.2. |
ClientSecret | Client password issued to the client during the registration process described by Section 2.2. |
RefreshToken | Refresh token used to obtain a new access token (if supported by the authorization server). |
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 |
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. See https://dev.twitch.tv/docs/authentication#revoking-access-tokens |
validate_token | Validate this token. Should be checked on regularly, according to https://dev.twitch.tv/docs/authentication#validating-requests |
Type Definitions
TwitchClient | Client for Twitch OAuth2 |