[英]CQ5: How can I propagate a logged-in user's security context to an integrated web application?
Given is the following: 给出以下内容:
Question: Once the user is logged-in, how can the CMS propagate the user's identity (with proof of his authentication) reliably to the integrated web application? 问题:用户登录后,CMS如何将用户身份(带有身份验证证明)可靠地传播到集成Web应用程序?
Its really the question of what you want to share as authentication to web-service. 真正的问题是您想与Web服务共享哪些身份验证。 Your question doesn't specify what kind of web-service call it is? 您的问题没有指定调用哪种网络服务?
Once user is logged in then you can get the username from below code. 用户登录后,您可以从以下代码中获取用户名。 It will give you anonymous
if user is not logged-in. 如果用户未登录,它将给您anonymous
。
Using this information you can make a call to web-service conditionally. 使用此信息,您可以有条件地调用Web服务。 And it also depends on what kind of hand-shake is happening b/w AEM and Spring web-service. 而且,这还取决于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.