以下摘自Picketlink Federation 2.5.4 SP4類org.picketlink.identity.federation.web.handlers.saml2.SAML2AuthenticationHandler,隨附Jboss 6.4(picketlink.org上沒有標籤github for 2.5 .4 SP4?)。我的問題是,第一行,request.getRequestDocument()返回null。對象本身,請求(SAML2HandlerRequest)看起來很好(NOT NULL):Picketlink獲取null
public void handleStatusResponseType(SAML2HandlerRequest request, SAML2HandlerResponse response)
throws ProcessingException {
HTTPContext httpContext = (HTTPContext) request.getContext();
ResponseType responseType = (ResponseType) request.getSAML2Object();
(...)
Document responseDocument = request.getRequestDocument();
Element assertionElement =
DocumentUtil.getChildElement(responseDocument.getDocumentElement(),
new QName(JBossSAMLConstants.ASSERTION.get()));
if (assertionElement != null) {
try {
Document assertionDocument = DocumentUtil.createDocument();
Node clonedAssertion = assertionElement.cloneNode(true);
assertionDocument.adoptNode(clonedAssertion);
assertionDocument.appendChild(clonedAssertion);
String assertionAttributeName = (String) handlerConfig
.getParameter(GeneralConstants.ASSERTION_SESSION_ATTRIBUTE_NAME);
if (assertionAttributeName != null) {
session.setAttribute(assertionAttributeName, assertionDocument);
}
session.setAttribute(GeneralConstants.ASSERTION_SESSION_ATTRIBUTE_NAME, assertionDocument);
} catch (ConfigurationException e) {
throw new ProcessingException("Could not store assertion document into session.", e);
}
}
僅供參考,我需要這個文件的原因是,當你在代碼中看到,如果responseDocument爲null,則asserionElement是空值。如果assertionElement爲null,那麼我的SAML令牌將不會在給定密鑰下的HTTPSession中,這就是我所需要的。
身份提供者是PingIdentity。在我必須學習整個PicketLink代碼庫之前,可能會發生什麼的提示或技巧?
謝謝!
僅供參考,我的設置是jboss 6.4,隨附Picketlink(2.5.4 SP4),帶有PingIdentity for SAML令牌(IdP)。僅供參考,所有工作都是從WebApp 1到WebApp 2的單點登錄方案,唯一的是我需要從WebApp 2上的SSO會話獲取SAML令牌....