pub enum Token {
Access {
consumer: KeyPair,
access: KeyPair,
},
Bearer(String),
}
Expand description
A token that can be used to sign requests to Twitter.
Conceptually, a Token represents your authorization to call the Twitter API. It can either be a Bearer token, representing a “logged-out” view of Twitter coming from your app itself; or an Access token, representing a combination of your app’s “consumer” key with a specific user granting access for your app to use the Twitter API on their behalf. For more information, see the authentication documentation.
Once you have obtained a Token of either kind, the keys within may be saved and reused in the future, as long as the access has not been revoked. Note that the keys saved in this type work just like a password, and they should be handled with care when you save them! If you believe your keys have been compromised, you can generate a new consumer token in Twitter’s Apps Dashboard, and if you’ve been using a Bearer token, you should invalidate it and generate a new one.
Variants§
Access
Fields
An OAuth Access token indicating the request is coming from a specific user.
Bearer(String)
An OAuth Bearer token indicating the request is coming from the application itself, not a particular user.