Highlighted

How to Configure Dynamic Media on AEM 6.3 Publish Instance?

everseeker

19-01-2018

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

Replies

Highlighted

kautuk_sahni

Community Manager

01-02-2018

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!