public class OAuth2Authorization extends Object implements Authorization, Serializable, OAuth2Support
| Constructor and Description |
|---|
OAuth2Authorization(Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
String |
getAuthorizationHeader(HttpRequest req) |
OAuth2Token |
getOAuth2Token()
Obtains an OAuth 2 Bearer token.
|
int |
hashCode() |
void |
invalidateOAuth2Token()
Revokes an issued OAuth 2 Bearer Token.
|
boolean |
isEnabled()
Returns true if authorization credentials are set.
|
void |
setOAuth2Token(OAuth2Token oauth2Token)
Sets the OAuth 2 Bearer token.
|
void |
setOAuthConsumer(String consumerKey,
String consumerSecret)
Sets the OAuth consumer key and consumer secret.
|
String |
toString() |
public OAuth2Authorization(Configuration conf)
public void setOAuthConsumer(String consumerKey, String consumerSecret)
OAuth2SupportsetOAuthConsumer in interface OAuth2SupportconsumerKey - OAuth consumer keyconsumerSecret - OAuth consumer secretpublic OAuth2Token getOAuth2Token() throws TwitterException
OAuth2SupportgetOAuth2Token in interface OAuth2SupportTwitterException - when Twitter service or network is unavailable, or connecting non-SSL endpoints.public void setOAuth2Token(OAuth2Token oauth2Token)
OAuth2SupportsetOAuth2Token in interface OAuth2Supportoauth2Token - OAuth 2 Bearer tokenpublic void invalidateOAuth2Token()
throws TwitterException
OAuth2SupportinvalidateOAuth2Token in interface OAuth2SupportTwitterException - when Twitter service or network is unavailable, or connecting non-SSL endpoints.public String getAuthorizationHeader(HttpRequest req)
getAuthorizationHeader in interface Authorizationpublic boolean isEnabled()
AuthorizationisEnabled in interface AuthorizationCopyright © 2018. All rights reserved.