【发布时间】:2014-08-22 18:34:45
【问题描述】:
我正在尝试使用 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()被移除时,它会抛出 断言 samlAssertion =(Assertion) unmarshaller.unmarshall(x1);
我有什么遗漏的吗?
【问题讨论】: