Package com.google.api.ads.common.lib.exception

Examples of com.google.api.ads.common.lib.exception.OAuthException


  private String getOAuth2Header(OAuth2Compatible oAuth2Compatible) throws OAuthException {
    if (adsLibConfiguration.isAutoRefreshOAuth2TokenEnabled()) {
      try {
        oAuth2Helper.refreshCredential(oAuth2Compatible.getOAuth2Credential());
      } catch (IOException e) {
        throw new OAuthException("OAuth2 token could not be refreshed.", e);
      }
    }

    return oAuth2AuthorizationHeaderProvider.getOAuth2AuthorizationHeader(oAuth2Compatible);
  }
View Full Code Here


        .setTokenServerEncodedUrl(tokenServerUrl)
        .build();
    credential.setRefreshToken(refreshToken);
    try {
      if (!oAuth2Helper.callRefreshToken(credential)) {
        throw new OAuthException(
            "Credential could not be refreshed. A newly generated refresh token may be required.");
      }
    } catch (IOException e) {
      throw new OAuthException("Credential could not be refreshed.", e);
    }
    return credential;
  }
View Full Code Here

      // Set authorized credentials.
      credential.setFromTokenResponse(tokenResponse);

      return credential;
    } catch(IOException e) {
      throw new OAuthException("An error occured obtaining the OAuth2Credential",  e.getCause());
    }
  }
View Full Code Here

TOP

Related Classes of com.google.api.ads.common.lib.exception.OAuthException

Copyright © 2018 www.massapicom. 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.