How to handle empty SAML attribute in the SAML handler? | Community
Skip to main content
March 6, 2018
Solved

How to handle empty SAML attribute in the SAML handler?

  • March 6, 2018
  • 3 replies
  • 3461 views

I have a requirement to fetch some SAML response attributes. For that I have configured those attributes in the Synchronized Attributes field in the AEM SAML 2.0 Authentiacation Handler. But for some users one of my synchronized attribute will be empty. The admin team reports that this is throwing error. Is there any way to handle empty SAML attribute values.

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 MC_Stuff

To prevent saving conditionally the right way is extending SAMLAuthenticationHandler.  Other options are implement authentication post processor or listener to remove the property after it is saved.

3 replies

MC_Stuff
March 6, 2018

Hi Adarsh,

Configure on the IDP not to pass empty attribute Or some default value if it is empty.  Otherwise need an custom development effort to extend SAMLAuuthenticationhandler to plugin your additional validation.

Thanks,

March 6, 2018

Thanks @MC Stuff. I was actually thinking about not to use any filters or extend SAMLAuthenticationHandler but to get the data using Userproperties API. Is there any other configuration that can be done in AEM side to prevent the attribute from saving in the jcr.

MC_Stuff
MC_StuffAccepted solution
March 6, 2018

To prevent saving conditionally the right way is extending SAMLAuthenticationHandler.  Other options are implement authentication post processor or listener to remove the property after it is saved.