Can't decode saml message from shibboleth SP - invalid byte 1 of 1-byte UTF-8 sequence

iljkr at tiscali.it iljkr at tiscali.it
Wed Feb 8 15:01:49 UTC 2023


  We have a Service Provider Shibboleth Sp v2 and a custom IDP in
java.

Usually in our custom idp we successfully decode saml messages
like this:

String samlmessage =
request.getParameter("SAMLResponse");
or
String samlmessage =
request.getParameter("SAMLRequest");

byte[] base64DecodedResponse =
Base64.decodeBase64(samlmessage);
ByteArrayInputStream is = new
ByteArrayInputStream(base64DecodedResponse);
DocumentBuilderFactory
documentBuilderFactory =
DocumentBuilderFactory.newInstance();
documentBuilderFactory.setNamespaceAware(true);
DocumentBuilder
docBuilder = documentBuilderFactory.newDocumentBuilder();
Document
document = docBuilder.parse(is);
etc.

We have a problem decoding the
logout request sent by the shibboleth sp to our idp:

At this
instruction: Document document = docBuilder.parse(is);
this exception is
raised:
org.apache.xerces.impl.io.MalformedByteSequenceException:
Invalid byte 1 of 1-byte UTF-8 sequence.

With saml tracer I see the
saml of all messages, also the one that in java gives me the
exception.

But if I take the value of these parameters (always from
saml tracer), for example:
SAMLResponse: PHNhbWxwOlJlc3BvbnNlIER etc
etc
SAMLRequest: nVNdb6JAFP0rhNdGgUGFTtSE etc etc

and i test in a
decoder like this with utf-8:

https://www.base64decode.org/

Are
decoded except the one that in java gives me an exception.

If saml
tracer shows me the saml message value, it somehow managed to decode
it..where am I wrong in the decoding?

Thanks for any helps.
IJ 



VOUCHER CONNETTIVITÀ per P.IVA e PMI: internet a canone 0 per 48 mesi. ATTIVA ORA
 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..

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20230208/940d4aa7/attachment.htm>


More information about the users mailing list