I am trying to create an SAML 2.0 assertion with OpenSAML using an existing assertion element for a token renewal process.
// Obtain the token
Token tk = tkStorage.getToken(data.getTokenId());
OMElement assertionOMElement = tk.getToken();
int samlRstversion = data.getSamlRstVersion();
if(samlRstversion == 2) {
DefaultBootstrap.bootstrap();
UnmarshallerFactory unmarshallerFactory = Configuration.getUnmarshallerFactory();
Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller((Element)assertionOMElement);
Element x1 = (Element)assertionOMElement;
Assertion samlAssertion = (Assertion) unmarshaller
.unmarshall(x1);
//Add conditions to the assertion
}
I'm getting two errors.
- When the
DefaultBootstrap.bootstrap();
is used, it throws an exceptionjava.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
- When
DefaultBootstrap.bootstrap()
is removed it throws at Assertion samlAssertion =(Assertion) unmarshaller.unmarshall(x1);
Is there something that I have missed?