code: public static String generateAuthorizeUrl(String oAuthUri, String clientId, String[] scope){
          StringBuilder sb = new StringBuilder(oAuthUri);
          sb.append("/oauth/authorize?response_type=code");
          sb.append("&client_id=" + clientId);
          if (scope != null) {
              sb.append("&scope=");
              for (int i = 0; i < scope.length; i++) {
                  if (i > 0) {
                      sb.append("%20");
                  }
                  sb.append(scope[i]);
              }
          }
          return sb.toString();
      }
docs: Generates the initial url for the OAuth authorization flow
  @return oauth authorize url