简体   繁体   中英

CQ5: How can I propagate a logged-in user's security context to an integrated web application?

Given is the following:

  • an AEM CMS which allows login of users
  • a Java web application (built with Spring) that is integrated into the AEM CMS via URL.

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?

Its really the question of what you want to share as authentication to web-service. 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.

Using this information you can make a call to web-service conditionally. And it also depends on what kind of hand-shake is happening b/w AEM and Spring web-service.

com.adobe.granite.security.user.UserProperties
UserProperties userProfile = slingRequest.getResourceResolver().adaptTo(UserProperties.class);
            if(null != userProfile){
                UserName = userProfile.getAuthorizableID();
            }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM