Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

How to Configure Dynamic Media on AEM 6.3 Publish Instance?

everseeker
Level 2
Level 2

Hi,

I have successfully configured the Dynamic Media on AEM 6.3 with aem-6.3.1-cfp-1.0.zip. There is a custom video component uses the below code snippet which works perfectly fine on author instance but does not work on publish instance. Feature Packs 14410 and 18912 are NOT INSTALLED

public String extractVideoServerUrl() {
    final Optional<String> videoServerUrl = ofNullable(DynamicMediaServicesConfigUtil.getServiceUrl(getResourceResolver()));
    final Optional<String> publicKey = ofNullable(DynamicMediaServicesConfigUtil.getPublicKey(getResourceResolver()));
    return videoServerUrl.isPresent() && publicKey.isPresent()
    ? new StringBuilder(videoServerUrl.get()).append(DYNAMIC_MEDIA_PUBLIC_STORAGE_PREFIX).append(publicKey.get()).append(SLASH).toString()
    : EMPTY;
}

A system user “videouser” who is allowed to read the dynamic media cloud configuration is used to obtain resource resolver. At this line -

com.day.cq.dam.commons.util.DynamicMediaServicesConfigUtil.getPublicKey(getResourceResolver()), it throws the below exception.

com.day.cq.dam.s7dam.common.config.impl.DynamicMediaServicesConfigImpl Failed to decrypt password

com.adobe.granite.crypto.CryptoException: Cannot convert byte data

                at com.adobe.granite.crypto.internal.CryptoSupportImpl.unprotect(CryptoSupportImpl.java:130)

                at com.day.cq.dam.s7dam.common.config.impl.DynamicMediaServicesConfigImpl.getRegistrationId(DynamicMediaServicesConfigImpl.java:68)

                at com.day.cq.dam.commons.util.DynamicMediaServicesConfigUtil.getDefaultConfig(DynamicMediaServicesConfigUtil.java:93)

                at com.day.cq.dam.commons.util.DynamicMediaServicesConfigUtil.getServiceUrl(DynamicMediaServicesConfigUtil.java:233)

                at com.day.cq.dam.commons.util.DynamicMediaServicesConfigUtil.getServiceUrl(DynamicMediaServicesConfigUtil.java:219)

                at

Caused by: com.adobe.granite.crypto.CryptoException: Failed decrypting cipher text

                at com.adobe.granite.crypto.internal.CryptoSupportImpl.decrypt(CryptoSupportImpl.java:66)

                at com.adobe.granite.crypto.internal.CryptoSupportImpl.unprotect(CryptoSupportImpl.java:127)

                ... 267 common frames omitted

Caused by: com.rsa.jsafe.JSAFE_PaddingException: Invalid padding.

                at com.rsa.jsafe.JSAFE_SymmetricCipher.decryptFinal(Unknown Source)

                at com.adobe.granite.crypto.internal.jsafe.JSafeCryptoSupport.getPlainText(JSafeCryptoSupport.java:267)

                at com.adobe.granite.crypto.internal.jsafe.JSafeCryptoSupport.getPlainText(JSafeCryptoSupport.java:249)

                at com.adobe.granite.crypto.internal.CryptoSupportImpl.decrypt(CryptoSupportImpl.java:64)

                ... 268 common frames omitted

2 Replies
kautuk_sahni
Employee
Employee

Did you checked the documentation:- Configuring Dynamic Media

This article talks about Setting up of Dynamic media:- Setting Up Dynamic Media

Here is Helpx article on how to work with Experience Manager Digital Assets and Dyamic Media:-  Working with Adobe Experience Manager and Dynamic Media

This should help you!

preeti_bhaya
Level 2
Level 2

Did you get a solution to this?

I am getting the same issue while upgrading from 6.2 to 6.4