code: public static URL getAuthorizationURL(String clientID, URI redirectUri, String state, List<String> scopes) {
          URLTemplate template = new URLTemplate(AUTHORIZATION_URL);
          QueryStringBuilder queryBuilder = new QueryStringBuilder().appendParam("client_id", clientID)
                  .appendParam("response_type", "code")
                  .appendParam("redirect_uri", redirectUri.toString())
                  .appendParam("state", state);
  
          if (scopes != null && !scopes.isEmpty()) {
              StringBuilder builder = new StringBuilder();
              int size = scopes.size() - 1;
              int i = 0;
              while (i < size) {
                  builder.append(scopes.get(i));
                  builder.append(" ");
                  i++;
              }
              builder.append(scopes.get(i));
  
              queryBuilder.appendParam("scope", builder.toString());
          }
  
          return template.buildWithQuery("", queryBuilder.toString());
      }
docs: Return the authorization URL which is used to perform the authorization_code based OAuth2 flow.
  @param clientID the client ID to use with the connection.
  @param redirectUri the URL to which Box redirects the browser when authentication completes.
  @param state the text string that you choose.
  Box sends the same string to your redirect URL when authentication is complete.
  @param scopes this optional parameter identifies the Box scopes available
  to the application once it's authenticated.
  @return the authorization URL