Package com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessTokenRequest

Examples of com.google.api.client.googleapis.auth.oauth2.draft10.GoogleAccessTokenRequest.GoogleAuthorizationCodeGrant.execute()


        }

        try {
            GoogleRefreshTokenRequest refreshTokenRequest = new GoogleRefreshTokenRequest(TRANSPORT, JSON_FACTORY, tokenData.getRefreshToken(),
                    this.clientID, this.clientSecret);
            GoogleTokenResponse refreshed = refreshTokenRequest.execute();

            // Update only 'accessToken' with new value
            tokenData.setAccessToken(refreshed.getAccessToken());

            if (log.isTraceEnabled()) {
View Full Code Here


        }

        try {
            GoogleRefreshTokenRequest refreshTokenRequest = new GoogleRefreshTokenRequest(TRANSPORT, JSON_FACTORY, tokenData.getRefreshToken(),
                    this.clientID, this.clientSecret);
            GoogleTokenResponse refreshed = refreshTokenRequest.execute();

            // Update only 'accessToken' with new value
            tokenData.setAccessToken(refreshed.getAccessToken());

            if (log.isTraceEnabled()) {
View Full Code Here

    GoogleAuthorizationCodeGrant authRequest = new GoogleAuthorizationCodeGrant(
        new UrlFetchTransport(), new JacksonFactory(), clientId, clientSecret, code, callbackUrl);

    AccessTokenResponse authResponse;
    try {
      authResponse = authRequest.execute();
    } catch (IOException e) {
      log.log(Level.WARNING, "Failed attempt, trying again", e);
      if (e instanceof HttpResponseException) {
        HttpResponseException f = (HttpResponseException) e;
        ByteArrayOutputStream o = new ByteArrayOutputStream();
View Full Code Here

    // Exchange for an access and refresh token
    GoogleAuthorizationCodeGrant authRequest = new GoogleAuthorizationCodeGrant(transport,
        factory, clientId, clientSecret, authorizationCode, AUTH_REDIRECT_URI);
    authRequest.useBasicAuthorization = false;
    AccessTokenResponse authResponse = authRequest.execute();

    accessToken = authResponse.accessToken;
    refreshToken = authResponse.refreshToken;

    GoogleAccessProtectedResource access = new GoogleAccessProtectedResource(accessToken, transport,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.