Expand my Community achievements bar.

SOLVED

Access DAM assets publicly without logging in to AEM

Avatar

Level 3

Hi,

 

I want access assets outside AEM, publicly so that the URL is passed as source of an API call, solution required which does not include allowing anonymous access to DAM folder.

 

Regards 

Nandan

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi Nandan,

Using signed URLs allows you to access assets stored in AEM externally without allowing anonymous access to the DAM folder. For more details you can refer https://medium.com/@monendra80/enabling-anonymous-access-to-aem-assets-with-signed-urls-4b5342f73c4d

 

Hope this helps.

Thanks,

Monendra

View solution in original post

4 Replies

Avatar

Correct answer by
Level 4

Hi Nandan,

Using signed URLs allows you to access assets stored in AEM externally without allowing anonymous access to the DAM folder. For more details you can refer https://medium.com/@monendra80/enabling-anonymous-access-to-aem-assets-with-signed-urls-4b5342f73c4d

 

Hope this helps.

Thanks,

Monendra

Avatar

Level 1
SignedUrlOptions options = new SignedUrlOptions(assetResource.getPath())

 

Where can I find this class SignedUrlOptions? What package? What dependency?

Thank you!!

Avatar

Community Advisor

Hello @nandan123 

JWT tokens can be used to access AEM resources. 

  • The first step in using AEM Resource is to generate JWT using client Id and client secret from AEM instance. These values can be obtained either from developer console of Cloud Manager/ OSGI Config.
  • Creating a JSON Web token: https://github.com/adobe-apiplatform/umapi-documentation/blob/master/samples/JWTExchange.py
  • Pass the signed, base-64 encoded JWT as the value of the URL-encoded jwt_token parameter in the body of the POST request in exchange for access token.
  • Pass the Resource URL with appropriate HTTP Authorization header. The header includes the access token from above. The access token is valid for 24 hours.

headers = {

    "Content-type" : "application/json",

    "Accept" : "application/json",

    "x-api-key" : api_key,

    "Authorization" : "Bearer " + access_token

    }

  • The subsequent requests are then the Resource URL with the authorization header to AEM and this will return the resource to the external system.
  •  

For details, please refer to: https://experience-aem.blogspot.com/2021/07/aem-cloud-service-get-adobe-ims-jwt-and-aem-access-token...

https://experienceleague.adobe.com/docs/experience-manager-learn/forms/aem-forms-with-adobe-campaign... 

 

Thanks,

Aanchal


Aanchal Sikka