Page business logic based on SAML response | Community
Skip to main content
October 16, 2020
Solved

Page business logic based on SAML response

  • October 16, 2020
  • 2 replies
  • 1479 views

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

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Peter_Puzanovs

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

2 replies

Peter_Puzanovs
Community Advisor
Peter_PuzanovsCommunity AdvisorAccepted solution
Community Advisor
October 16, 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

joerghoh
Adobe Employee
Adobe Employee
October 16, 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(...)

 

 

October 27, 2020
Thanks that's clear. I need to understand how to be able to cache that page.