code: public String generateAuthenticationUrl(ResponseMode responseMode, String state) {
          return String.format("%s/%s/oauth2/authorize?client_id=%s&response_type=code&redirect_uri=%s&response_mode=%s&state=%s",
                  environment().activeDirectoryEndpoint(), domain(), clientId(), this.redirectUrl, responseMode.value, state);
      }
docs: Generate the URL to authenticate through OAuth2.
  
  @param responseMode the method that should be used to send the resulting token back to your app
  @param state a value included in the request that is also returned in the token response
  @return the URL to authenticate through OAuth2