<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html><body>
We have a Service Provider Shibboleth Sp v2 and a custom IDP in java.<br /><br />Usually in our custom idp we successfully decode saml messages like this:<br /><br />String samlmessage = request.getParameter("SAMLResponse");<br />or<br />String samlmessage = request.getParameter("SAMLRequest");<br /><br />byte[] base64DecodedResponse = Base64.decodeBase64(samlmessage);<br />ByteArrayInputStream is = new ByteArrayInputStream(base64DecodedResponse);<br />DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();<br />documentBuilderFactory.setNamespaceAware(true);<br />DocumentBuilder docBuilder = documentBuilderFactory.newDocumentBuilder();<br />Document document = docBuilder.parse(is);<br />etc.<br /><br />We have a problem decoding the logout request sent by the shibboleth sp to our idp:<br /><br />At this instruction: Document document = docBuilder.parse(is);<br />this exception is raised:<br />org.apache.xerces.impl.io.MalformedByteSequenceException: Invalid byte 1 of 1-byte UTF-8 sequence.<br /><br />With saml tracer I see the saml of all messages, also the one that in java gives me the exception.<br /><br />But if I take the value of these parameters (always from saml tracer), for example:<br />SAMLResponse: PHNhbWxwOlJlc3BvbnNlIER etc etc<br />SAMLRequest: nVNdb6JAFP0rhNdGgUGFTtSE etc etc<br /><br />and i test in a decoder like this with utf-8:<br /><br />https://www.base64decode.org/<br /><br />Are decoded except the one that in java gives me an exception.<br /><br />If saml tracer shows me the saml message value, it somehow managed to decode it..where am I wrong in the decoding?<br /><br />Thanks for any helps.<br />IJ
</body></html>
<br><br/><br/>VOUCHER CONNETTIVITÀ per P.IVA e PMI: internet a canone 0 per 48 mesi. ATTIVA ORA<br />
 <a href='https://casa.tiscali.it/promo/?u=https://promozioni.tiscali.it/voucher_business/?r=TS00000A00025&dm=link&p=tiscali&utm_source=tiscali&utm_medium=link&utm_campaign=voucherbusiness&wt_np=tiscali.link.footermail.voucherbusiness.btb..' target='_blank'>https://casa.tiscali.it/promo/?u=https://promozioni.tiscali.it/voucher_business/</a><br/><br/>