public static int validateSamlResponsePort(HttpServletRequest request)
      throws HttpSamlAuthenticationException {
    String responsePort = request.getHeader(SSO_TOKEN_RESPONSE_PORT);
    if (responsePort == null || responsePort.isEmpty()) {
      throw new HttpSamlAuthenticationException("No response port specified");
    }
    try {
      return Integer.parseInt(responsePort);
    } catch (NumberFormatException e) {
      throw new HttpSamlAuthenticationException("Invalid response port received", e);
    }
  }
Validates and returns the SAML response port number from the request.
service/src/java/org/apache/hive/service/auth/saml/HiveSamlUtils.java