use of org.dataportabilityproject.shared.auth.TokenSecretAuthData in project data-transfer-project by google.
the class FlickrAuth method getAuth.
public Auth getAuth(AuthData authData) throws IOException {
checkArgument(authData instanceof TokenSecretAuthData, "authData expected to be TokenSecretAuthData not %s", authData.getClass().getCanonicalName());
Token requestToken = fromAuthData(authData);
try {
Auth auth = flickr.getAuthInterface().checkToken(requestToken);
return auth;
} catch (FlickrException e) {
throw new IOException("Problem verifying auth token", e);
}
}
use of org.dataportabilityproject.shared.auth.TokenSecretAuthData in project data-transfer-project by google.
the class SmugMugAuth method generateConsumer.
OAuthConsumer generateConsumer(AuthData authData) {
Preconditions.checkArgument(authData instanceof TokenSecretAuthData, "authData expected to be TokenSecretAuthData not %s", authData.getClass().getCanonicalName());
TokenSecretAuthData tokenSecretAuthData = (TokenSecretAuthData) authData;
OAuthConsumer consumer = new GoogleOAuthConsumer(appCredentials.key(), appCredentials.secret());
consumer.setTokenWithSecret(tokenSecretAuthData.token(), tokenSecretAuthData.secret());
return consumer;
}
Aggregations