Page business logic based on SAML response | Community
Skip to main content
New Participant
Oct 16, 2020 8:21 AM UTC
Solved

Page business logic based on SAML response

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.
Peter_Puzanovs
Peter_PuzanovsAccepted solution
New Participant
Oct 16, 2020 9:31 AM UTC

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

3 replies

joerghoh
Employee
Oct 16, 2020 7:35 PM UTC

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

 

 

Translate
New Participant
Oct 27, 2020 8:20 AM UTC
Thanks that's clear. I need to understand how to be able to cache that page.
Translate
Peter_Puzanovs
Peter_PuzanovsAccepted solution
New Participant
Oct 16, 2020 9:31 AM UTC

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

Translate