Example usage for com.google.api.client.googleapis.auth.oauth2 GoogleAuthorizationCodeRequestUrl setScopes

List of usage examples for com.google.api.client.googleapis.auth.oauth2 GoogleAuthorizationCodeRequestUrl setScopes

Introduction

In this page you can find the example usage for com.google.api.client.googleapis.auth.oauth2 GoogleAuthorizationCodeRequestUrl setScopes.

Prototype

@Override
    public GoogleAuthorizationCodeRequestUrl setScopes(Collection<String> scopes) 

Source Link

Usage

From source file:utils.gce.auth.GoogleComputeEngineAuthImpl.java

License:Apache License

public String getRefreshTokenURL(final String redirectUri) throws GoogleComputeEngineException {
    GoogleAuthorizationCodeRequestUrl url = authorizationCodeFlow.newAuthorizationUrl();
    //GoogleAuthorizationCodeRequestUrl url = new GoogleAuthorizationCodeRequestUrl(clientId, redirectUri, SCOPES).setAccessType("offline");
    url.setRedirectUri(redirectUri);//w w w  . ja  v a2  s. c o m
    url.setApprovalPrompt("force");
    url.setAccessType("offline");
    url.setClientId(clientId);
    url.setScopes(SCOPES);
    return url.build();
}