@Nullable
    public String getAuthorizationUrl() throws UnsupportedEncodingException {
        String authorizationCodeRequestUrl =
                authorizationCodeFlow.newAuthorizationUrl().setScopes(scopes).build();
        if (redirectUri != null) {
            authorizationCodeRequestUrl += "&redirect_uri=" + URLEncoder.encode(redirectUri, "UTF-8");
        }
        return authorizationCodeRequestUrl;
    }
@ Nullable public String getAuthorizationUrl ( ) throws UnsupportedEncodingException { String authorizationCodeRequestUrl = authorizationCodeFlow . newAuthorizationUrl ( ) . setScopes ( scopes ) . build ( ) ; if ( redirectUri != null ) { authorizationCodeRequestUrl += "&redirect_uri=" + URLEncoder . encode ( redirectUri , "UTF-8" ) ; } return authorizationCodeRequestUrl ; }
Gets the authorization URL to retrieve the authorization code.