com.google.appengine.api.appidentity.AppIdentityService.GetAccessTokenResult

Here are the examples of the java api class com.google.appengine.api.appidentity.AppIdentityService.GetAccessTokenResult taken from open source projects.

1. AppEngineCredentials#refreshAccessToken()

View license
/**
   * Refresh the access token by getting it from the App Identity service
   */
@Override
public AccessToken refreshAccessToken() throws IOException {
    if (createScopedRequired()) {
        throw new IOException("AppEngineCredentials requires createScoped call before use.");
    }
    GetAccessTokenResult accessTokenResponse = appIdentityService.getAccessToken(scopes);
    String accessToken = accessTokenResponse.getAccessToken();
    Date expirationTime = accessTokenResponse.getExpirationTime();
    return new AccessToken(accessToken, expirationTime);
}