com.google.api.client.auth.oauth.OAuthCredentialsResponse

Here are the examples of the java api class com.google.api.client.auth.oauth.OAuthCredentialsResponse taken from open source projects.

1. OAuthHmacThreeLeggedFlow#complete()

View license
public Credential complete(String authorizationCode) throws IOException {
    Preconditions.checkNotNull(transport, "Must call setHttpTransport before calling complete.");
    OAuthGetAccessToken accessToken = new OAuthGetAccessToken(authorizationServerUrl);
    accessToken.temporaryToken = tempToken;
    accessToken.transport = transport;
    OAuthHmacSigner signer = new OAuthHmacSigner();
    signer.clientSharedSecret = consumerSecret;
    signer.tokenSharedSecret = tempTokenSecret;
    accessToken.signer = signer;
    accessToken.consumerKey = consumerKey;
    accessToken.verifier = authorizationCode;
    OAuthCredentialsResponse credentials = accessToken.execute();
    signer.tokenSharedSecret = credentials.tokenSecret;
    OAuthHmacCredential accessCredential = new OAuthHmacCredential(userId, consumerKey, consumerSecret, credentials.tokenSecret, credentials.token);
    return accessCredential;
}