/* package */ static Request addScope(Request request, String[] scopes) {
        if (scopes != null && scopes.length > 0) {
            StringBuilder scope = new StringBuilder();
            for (int i=0; i<scopes.length; i++) {
                scope.append(scopes[i]);
                if (i < scopes.length-1) scope.append(" ");
            }
            request.add("scope", scope.toString());
        }
        return request;
    }