public class AuthenticatedRemoteConnector extends RemoteConnectorAdapter
| Constructor and Description |
|---|
AuthenticatedRemoteConnector(RemoteConnector delegate,
AuthenticationStore store)
Creates a connector that delegates to an underlying connector
and saves its access token in an authentication store
|
| Modifier and Type | Method and Description |
|---|---|
void |
authorize(String verificationCode)
Authorizes the app.
|
void |
setAccessToken(String token,
String secret)
Authorizes the app.
|
getAccessTokenSecret, getAccessTokenValue, getAuthorizationURL, getItem, getItemIDs, getItems, getMaxBulkItemspublic AuthenticatedRemoteConnector(RemoteConnector delegate, AuthenticationStore store)
delegate - the underlying connectorstore - the authentication storepublic void authorize(String verificationCode) throws IOException
RemoteConnectorRemoteConnector.getAuthorizationURL(), this method has to be
called to finish authorizationauthorize in interface RemoteConnectorauthorize in class RemoteConnectorAdapterverificationCode - the verification code the user received from
the authorization URLIOException - if authorization failedpublic void setAccessToken(String token, String secret)
RemoteConnectorAuthorizes the app. If you already know a valid OAuth access token
(for example if you cached it from previous sessions) you may call
this method instead of RemoteConnector.getAuthorizationURL() and
RemoteConnector.authorize(String).
This method just saves the provided access token. It does not act with the remote service in any way.
setAccessToken in interface RemoteConnectorsetAccessToken in class RemoteConnectorAdaptertoken - the access token valuesecret - the access token's secretRemoteConnector.getAccessTokenValue(),
RemoteConnector.getAccessTokenSecret()