All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.appengine.tools.cloudstorage.oauth.AppIdentityAccessTokenProvider Maven / Gradle / Ivy

There is a newer version: 0.8.3
Show newest version
package com.google.appengine.tools.cloudstorage.oauth;

import com.google.appengine.api.appidentity.AppIdentityService;
import com.google.appengine.api.appidentity.AppIdentityService.GetAccessTokenResult;
import com.google.appengine.api.appidentity.AppIdentityServiceFactory;
import com.google.appengine.api.utils.SystemProperty;

import java.util.List;

/**
 * Provider that uses the AppIdentityService for generating access tokens.
 */
final class AppIdentityAccessTokenProvider implements AccessTokenProvider {
  private final AppIdentityService appIdentityService;

  public AppIdentityAccessTokenProvider() {
    this.appIdentityService = AppIdentityServiceFactory.getAppIdentityService();
  }

  @Override
  public GetAccessTokenResult getNewAccessToken(List scopes) {
    return appIdentityService.getAccessToken(scopes);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy