public interface OAuthSupport
Modifier and Type | Method and Description |
---|---|
AccessToken |
getOAuthAccessToken()
Returns an access token associated with this instance.
If no access token is associated with this instance, this will retrieve a new access token. |
AccessToken |
getOAuthAccessToken(RequestToken requestToken)
Retrieves an access token associated with the supplied request token and sets userId.
|
AccessToken |
getOAuthAccessToken(RequestToken requestToken,
String oauthVerifier)
Retrieves an access token associated with the supplied request token and sets userId.
|
AccessToken |
getOAuthAccessToken(String oauthVerifier)
Retrieves an access token.
|
AccessToken |
getOAuthAccessToken(String screenName,
String password)
Retrieves an access token associated with the supplied screen name and password using xAuth.
In order to get access acquire AccessToken using xAuth, you must apply by sending an email to api@twitter.com — all other applications will receive an HTTP 401 error. |
RequestToken |
getOAuthRequestToken()
Retrieves a request token
|
RequestToken |
getOAuthRequestToken(String callbackURL)
Retrieves a request token
|
RequestToken |
getOAuthRequestToken(String callbackURL,
String xAuthAccessType)
Retrieves a request token
|
RequestToken |
getOAuthRequestToken(String callbackURL,
String xAuthAccessType,
String xAuthMode)
Retrieves a request token
|
void |
setOAuthAccessToken(AccessToken accessToken)
Sets the access token
|
void |
setOAuthConsumer(String consumerKey,
String consumerSecret)
sets the OAuth consumer key and consumer secret
|
void setOAuthConsumer(String consumerKey, String consumerSecret)
consumerKey
- OAuth consumer keyconsumerSecret
- OAuth consumer secretIllegalStateException
- when OAuth consumer has already been set, or the instance is using basic authorizationRequestToken getOAuthRequestToken() throws TwitterException
TwitterException
- when Twitter service or network is unavailableIllegalStateException
- access token is already availableRequestToken getOAuthRequestToken(String callbackURL) throws TwitterException
callbackURL
- callback URLTwitterException
- when Twitter service or network is unavailableIllegalStateException
- access token is already availableRequestToken getOAuthRequestToken(String callbackURL, String xAuthAccessType) throws TwitterException
callbackURL
- callback URLxAuthAccessType
- Overrides the access level an application requests to a users account. Supported values are read or write. This parameter is intended to allow a developer to register a read/write application but also request read only access when appropriate.TwitterException
- when Twitter service or network is unavailableIllegalStateException
- access token is already availableRequestToken getOAuthRequestToken(String callbackURL, String xAuthAccessType, String xAuthMode) throws TwitterException
callbackURL
- callback URLxAuthAccessType
- Overrides the access level an application requests to a users account. Supported values are read or write. This parameter is intended to allow a developer to register a read/write application but also request read only access when appropriate.xAuthMode
- Set to reverse_auth to obtain a special request token to be used in the reverse auth process.TwitterException
- when Twitter service or network is unavailableIllegalStateException
- access token is already availableAccessToken getOAuthAccessToken() throws TwitterException
TwitterException
- when Twitter service or network is unavailable, or the user has not authorizedIllegalStateException
- when RequestToken has never been acquiredAccessToken getOAuthAccessToken(String oauthVerifier) throws TwitterException
oauthVerifier
- OAuth verifier. AKA pin.TwitterException
- when Twitter service or network is unavailable, or the user has not authorizedAccessToken getOAuthAccessToken(RequestToken requestToken) throws TwitterException
requestToken
- the request tokenTwitterException
- when Twitter service or network is unavailable, or the user has not authorizedAccessToken getOAuthAccessToken(RequestToken requestToken, String oauthVerifier) throws TwitterException
requestToken
- the request tokenoauthVerifier
- OAuth verifier. AKA pin.TwitterException
- when Twitter service or network is unavailable, or the user has not authorizedAccessToken getOAuthAccessToken(String screenName, String password) throws TwitterException
screenName
- the screen namepassword
- the passwordTwitterException
- when Twitter service or network is unavailable, or the user has not authorizedvoid setOAuthAccessToken(AccessToken accessToken)
accessToken
- accessTokenCopyright © 2018. All rights reserved.