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)
OAuth2Support
setOAuthConsumer
in interface OAuth2Support
consumerKey
- OAuth consumer keyconsumerSecret
- OAuth consumer secretpublic OAuth2Token getOAuth2Token() throws TwitterException
OAuth2Support
getOAuth2Token
in interface OAuth2Support
TwitterException
- when Twitter service or network is unavailable, or connecting non-SSL endpoints.public void setOAuth2Token(OAuth2Token oauth2Token)
OAuth2Support
setOAuth2Token
in interface OAuth2Support
oauth2Token
- OAuth 2 Bearer tokenpublic void invalidateOAuth2Token() throws TwitterException
OAuth2Support
invalidateOAuth2Token
in interface OAuth2Support
TwitterException
- when Twitter service or network is unavailable, or connecting non-SSL endpoints.public String getAuthorizationHeader(HttpRequest req)
getAuthorizationHeader
in interface Authorization
public boolean isEnabled()
Authorization
isEnabled
in interface Authorization
Copyright © 2018. All rights reserved.