Monday, April 29, 2019

AEM groovies that makes developer life easy

In this blog, I am writing some very useful groovy in AEM.

1. Groovy to export all the users and their associated groups n AEM.


2.  Groovy to export all the Groups and their members in AEM.



Very soon I am posting more useful  AEM groovy on this blog.


For any query and suggestion please comment or write us an email atrishabhy555@gmail.com 

Monday, April 15, 2019

AEM SSO using SAML

In this blog, we are going to see how to implement Single-sign on using Microsoft Azure AD.


AEM ships with a SAML authentication handler. This handler provides support for the SAML 2.0 Authentication Request Protocol (Web-SSO profile) using the HTTP POST binding.


Now let's see  what we have to do to configure SAML in AEM. 

This includes two major steps first is adding the identity provider(IDP) certificate to AEM truststore. And the second step is to configure  SAML authentication handler.


Step 1.  adding the identity provider(IDP) certificate to AEM truststore

  • Go to:  http://{server }: {port}/libs/granite/security/content/useradmin.html
  • Select any existing user or create new user because TrustStore is global to AEM
  • Upload the IdP certificate & make note of the certificate Alias and provide the cert alias in SAML authentication configuration
  • Create KeyStore by supplying the password for authentication-service user (default user provided by AEM )




Step 2: configure  SAML authentication handler.
  • Go to:  http://{server }:{port}/system/console/configMgr
  • Search for Adobe Granite SAML 2.0 Authentication Handler
  • Add the IDP URL
  • Add the IDP Certificate Alias which we got in step 1
  • Add Service Provider Entity ID()
  • Add Password of Key Store(to get this password Select authentication-service and create keystore by giving a password )
  • Check Autocreate CRX Users( if it checked it will create a user in crx automatically )
  • provide NameIDPolicy Format
  • provide Default Groups (A list of default CRX groups in which users are added to after successful authentication)
  • Add Synchronized Attributes(list of attribute mappings (in the format "attributename=path/relative/to/user/node") which should be stored in the repository on user-synchronization)




NOTE: Sometimes we have to configure Referrer filter also for SAML
To configure ReferrerFilter go  http://{server }:{port}/system/console/configMgr and search for 'Apache Sling Referrer Filter'
provide the hostname which will allow hosts for the referrer. 



for reference please visit below links:

for debugging we can use a plugin saml tracer in this we can see what is the SAML response coming


For any query and suggestion please comment or write us an email at rishabhy555@gmail.com 

AEm 6.2 show hide tabs in a component TOUCH UI

When we are developing AEM component we came up with a lot of situation where we want to show tabs on the basis of selection. And in selection also we have two scenarios.

Scenario 1: when we want to show a number of selected tabs. example if we select tab 6 from dropdown so our component will show 6 Tabs. for reference please see the screenshots below


To solve this scenario I am giving the sample code for cq_dialog.xml code and js code.

cq_dialog



showhidetabs.js
 for this create a clientlib and add categories as cq.authoring.dialog and paste the js file in clientlib folder. For reference see the screenshot below





Once you are done with those changes add other things like cq_editConfig and write the HTML code for the component and then the component will work perfectly.