com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl

Here are the examples of the java api class com.google.api.client.auth.oauth2.AuthorizationCodeRequestUrl taken from open source projects.

1. OAuthAuthenticator#getAuthenticateUrl()

Project: che
Source File: OAuthAuthenticator.java
View license
/**
     * Create authentication URL.
     *
     * @param requestUrl
     *         URL of current HTTP request. This parameter required to be able determine URL for redirection after
     *         authentication. If URL contains query parameters they will be copy to 'state' parameter and returned to
     *         callback method.
     * @param scopes
     *         specify exactly what type of access needed
     * @return URL for authentication
     */
public String getAuthenticateUrl(URL requestUrl, List<String> scopes) throws OAuthAuthenticationException {
    if (!isConfigured()) {
        throw new OAuthAuthenticationException("Authenticator is not configured");
    }
    AuthorizationCodeRequestUrl url = flow.newAuthorizationUrl().setRedirectUri(findRedirectUrl(requestUrl)).setScopes(scopes);
    url.setState(prepareState(requestUrl));
    return url.build();
}