"Invalid inbound message transport type, this decoder only support HTTPInTransport");
}
SAMLMessageContext samlMsgCtx = (SAMLMessageContext) messageContext;
HTTPInTransport inTransport = (HTTPInTransport) samlMsgCtx.getInboundMessageTransport();
if (!inTransport.getHTTPMethod().equalsIgnoreCase("POST")) {
throw new MessageDecodingException("This message decoder only supports the HTTP POST method");
}
String relayState = inTransport.getParameterValue("TARGET");
samlMsgCtx.setRelayState(relayState);
log.debug("Decoded SAML relay state (TARGET parameter) of: {}", relayState);
String base64Message = inTransport.getParameterValue("SAMLResponse");
byte[] decodedBytes = Base64.decode(base64Message);
if (decodedBytes == null) {
log.error("Unable to Base64 decode SAML message");
throw new MessageDecodingException("Unable to Base64 decode SAML message");
}