我正在尝试使用 OpenSAML 使用现有的断言元素为令牌更新过程创建 SAML 2.0 断言。
// 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
}
我收到两个错误。
- 使用
DefaultBootstrap.bootstrap();
时会抛出异常java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
- 当
DefaultBootstrap.bootstrap()
被移除时,它会抛出 Assertion samlAssertion =(Assertion) unmarshaller.unmarshall(x1);
有什么我错过的吗?