Page business logic based on SAML response

francescob53463

16-10-2020

Good morning from Italy,

all the SAML guides for AEM explain how to protect a full page (the page is visible to logged user vs the page is not visibile to non logged user).

 

Can you please point out any guide that explain how to create a more granual business logic based on SAML data?

 

For example:

  • the page is public (everyone can see the page)
  • if the user is logged, AEM should shows his email somewhere in the header (taken from the SAML response or from userProps.getProperty("email") as explained here
  • if the user is not logged, instead of showing his email, a "login" link should be shown

 

Is there any guide that can explain how to do it?

thanks

Francesco

 

AEM businesslogic SAML

Accepted Solutions (1)

Accepted Solutions (1)

PuzanovsP

MVP

16-10-2020

Hello Francesco,

 

Unfortunately, since AEM 5.6.1 Adobe Saml library has been locked for any really cool work, so you can only use what's available OOTB,

 

Adobe Docs have these details[1]

 

They should give you a good starting point.

 

[1] https://helpx.adobe.com/experience-manager/using/aem63_saml.html

 

If you need more then what's there is OOTB you'll have lots of work ahead of you.

 

Regards,

Peter

Answers (1)

Answers (1)

Jörg_Hoh

Employee

16-10-2020

Hi Franceso,

Actually that's very easy, because it should not matter at all how a user got logged in. Assuming that you have mapped that user to a JCR user (what the standard SAML authentication does) you can just do something like

 

User user = request.getResource().adaptTo(User.class);

user.getProperties(...)