[英]get user attributes from previous authn in Shibboleth IDP 3 MFA flow
我正在嘗試為shibboleth idp 3構建一個兩因素身份驗證流。它是使用MFA流進行設置的,該流具有初始ldap身份驗證,然后是基於外部authn流的2FA流。
如何從servlet中的先前ldap流獲取用戶數據? 似乎request.getAttribute(ExternalAuthentication.PRINCIPAL_NAME_KEY)
等尚未設置。 文檔說LDAP屬性是作為身份驗證過程的一部分返回的,並在LDAPResponseContext中公開 。 如何在servlet中訪問上下文?
我還嘗試使用屬性解析器從AD用戶簡要表中釋放特定值,但是我無法在servlet中找到這些值。 有任何想法嗎?
我想通了,也許其他人發現它有幫助:
密碼流使用主體名稱填充c14n上下文,對我來說足夠了。 要在servlet中獲取主體名稱:
protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException {
try {
String authenticationKey = ExternalAuthentication.startExternalAuthentication(request);
// get userPrincipalName of previous authn
final ProfileRequestContext profileRequestContext = ExternalAuthentication.getProfileRequestContext(authenticationKey, request);
final SubjectCanonicalizationContext c14nContext = profileRequestContext.getSubcontext(SubjectCanonicalizationContext.class);
if (c14nContext != null && c14nContext.getPrincipalName() != null) {
usernameShib = c14nContext.getPrincipalName();
//Subject subjectShib = c14nContext.getSubject();
logger.info(usernameShib);
}
//...
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.