Expand my Community achievements bar.

SOLVED

How to restrict asset downloads on the AEM publish side?

Avatar

Level 2

We are building a website on AEM where the website visitors are allowed to download few assets (Such as PDF files, zip files, images etc). However, for certain assets, we have a requirement to capture the user's name and email ID before they could download the asset. Is there a way to implement this restriction on the publish side?

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @sai_rama_krishn ,

You can utilize CUG concept in order to achieve this. see this example - https://experienceleague.adobe.com/docs/experience-manager-learn/assets/advanced/closed-user-groups....

Just this configuration will not help you to achieve this, you will have to write a custom authentication handler. As soon as the user tries to access the restricted asset,  you can show a form popup or redirect and have a form where you will collect the user data, once the data is collected you will redirect the user to access/download the asset. Here is a sample implementation with the code - https://www.linkedin.com/pulse/creating-custom-authentication-handler-aem-cq5-navin-kaushal

 

some more useful links:

http://www.aemcq5tutorials.com/tutorials/implement-cug-aem/

https://www.albinsblog.com/2021/12/enable-user-authentication-for-aem-websites-azureadb2c-oauth.html...

View solution in original post

4 Replies

Avatar

Community Advisor

Hi,

 

Restricting download needs to be handled by javascript and depends on the browser, it is not something AEM can handle. You can create a form to enter user name and email id before allowing user to download.

Avatar

Correct answer by
Employee Advisor

Hi @sai_rama_krishn ,

You can utilize CUG concept in order to achieve this. see this example - https://experienceleague.adobe.com/docs/experience-manager-learn/assets/advanced/closed-user-groups....

Just this configuration will not help you to achieve this, you will have to write a custom authentication handler. As soon as the user tries to access the restricted asset,  you can show a form popup or redirect and have a form where you will collect the user data, once the data is collected you will redirect the user to access/download the asset. Here is a sample implementation with the code - https://www.linkedin.com/pulse/creating-custom-authentication-handler-aem-cq5-navin-kaushal

 

some more useful links:

http://www.aemcq5tutorials.com/tutorials/implement-cug-aem/

https://www.albinsblog.com/2021/12/enable-user-authentication-for-aem-websites-azureadb2c-oauth.html...