【发布时间】:2022-01-11 03:54:51
【问题描述】:
我正在尝试将我的代码从旧版本的 opensaml 迁移到版本 4.0.1
AuthnContextClassRef authnCtxClassRef = null;
final AuthnContext authnCtx = existing20authnStatement.getAuthnContext();
if (authnCtx != null) {
authnCtxClassRef = authnCtx.getAuthnContextClassRef();
if (authnCtxClassRef != null) {
authnCtxClassRefName = authnCtxClassRef.getAuthnContextClassRef();
if (authnCtxClassRefName != null) {
authNStmt.setAuthenticationInstant(now);
authNStmt.setAuthenticationMethod(translateAuthN20to11(authnCtxClassRefName));
authNStmt.setSubject(makeSubject(subjectName, nameId));
assertion.getAuthenticationStatements().add(authNStmt);
}
}
}
我可以从源代码中看到该类定义在org.opensaml.saml.saml2.core.AuthnContextClassRef 但是当我尝试导入它时,它说
AuthnContextClassRef 无法解析为类型
类 ConfirmationMethod 也是如此,编写的代码如下:
final ConfirmationMethod confirmationMethod = buildObj(ConfirmationMethodBuilder.class,ConfirmationMethod.DEFAULT_ELEMENT_NAME);
confirmationMethod.setConfirmationMethod(SAML10_CM_SENDER_VOUCHES);
【问题讨论】:
标签: java saml saml-2.0 opensaml