![](/img/trans.png)
[英]How to display current logged-in user's information in all templates including view managed by WebMvcConfigurerAdapter in Spring Security application
[英]CQ5: How can I propagate a logged-in user's security context to an integrated web application?
給出以下內容:
問題:用戶登錄后,CMS如何將用戶身份(帶有身份驗證證明)可靠地傳播到集成Web應用程序?
真正的問題是您想與Web服務共享哪些身份驗證。 您的問題沒有指定調用哪種網絡服務?
用戶登錄后,您可以從以下代碼中獲取用戶名。 如果用戶未登錄,它將給您anonymous
。
使用此信息,您可以有條件地調用Web服務。 而且,這還取決於AEM和Spring Web服務是否正在發生什么樣的握手。
com.adobe.granite.security.user.UserProperties
UserProperties userProfile = slingRequest.getResourceResolver().adaptTo(UserProperties.class);
if(null != userProfile){
UserName = userProfile.getAuthorizableID();
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.