OpenSAML V3: Problems while marshaling encrypted assertion
Brent Putman
putmanb at georgetown.edu
Thu Apr 27 18:11:56 EDT 2017
On 4/26/17 9:39 PM, Locatelli da Silva, Thiago wrote:
> This is how I am signing the assertion:
>
> private Assertion createSignedAssertion() throws SamlException {
>
> try {
>
>
>
> Signature signature = createSignature();
>
> Assertion assertion = createAssertion();
>
> assertion.setSignature(signature);
>
>
> MarshallerFactory marshallerFactory =
> XMLObjectProviderRegistrySupport.getMarshallerFactory();
>
>
> marshallerFactory.getMarshaller(assertion).marshall(assertion);
>
> Signer.signObject(signature);
>
>
> UnmarshallerFactory unmarshallerFactory =
> XMLObjectProviderRegistrySupport.getUnmarshallerFactory();
>
> Assertion signedAssertion = (Assertion)
> unmarshallerFactory.getUnmarshaller(assertion.getDOM()).unmarshall(assertion.getDOM());
>
>
> returnsignedAssertion;
>
>
The only thing that looks odd or unusual in your code so far is what you
are doing above to unmarshall a new Assertion object after you've signed
the input Assertion. You don't in general have to do that. You just
sign it as you are doing and then make use of the existing Assertion
instance. It's already signed. I don't know off-hand if what you are
doing could be screwing up the XML namespaces per the exception, but it
could be, as it certainly is related to the DOM instances that are
cached on the objects.
I would suggest to try just commenting out those two unmarshalling lines
above and just return the 'assertion' instance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20170427/c7a272ab/attachment.html>
More information about the dev
mailing list