[−][src]Crate twitch_oauth2
OAuth2 for Twitch endpoints
let token = AccessToken::new("sometokenherewhichisvalidornot".to_string());
match UserToken::from_existing(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; |
Structs
| AppAccessToken | An App Access Token from the OAuth client credentials flow |
| TwitchTokenErrorResponse | Twitch's representation of the oauth flow for errors |
| 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
| refresh_token | Refresh the token, call if it has expired. |
| revoke_token | Revoke the token. |
| validate_token | Validate this token. |
Type Definitions
| TwitchClient | Client for Twitch OAuth2 |