Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Page business logic based on SAML response

Avatar

Level 1

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

 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

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

Avatar

Employee Advisor

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(...)

 

 

Avatar

Level 1
Thanks that's clear. I need to understand how to be able to cache that page.