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

Error when enabling Encapsulated Token support for dual publish environment


Level 3

Good evening AEM Team!

We have integrated Okta as the IDM for our AEM 6.2 website. We have done so using a fairly standard SAML configuration which has worked well. In our live/production environment we have two publish instances so we have been testing the integration across two publish environments.

We have configured:

- Apache Sling Distribution Agents - Sync Agents Factory

- Adobe Granite Distribution - Encrypted Password Transport Secret Provider

- Apache Sling Distribution Trigger - Scheduled Triggers Factory

- Apache Sling Distribution Agent – Queue Agents Factory (on each Publish Instance)

- Adobe Granite Distribution – Diff Observer Factory (on each Publish Instance)

- AEM Communities User Sync Listener (on each Publish Instance)

We have also enabled Encapsulated Token Support:

- Day CRX Token Authentication Handler

(As described in your tech note here: (1))

We have had good results with user replication and we have been able to observe that the login-token is being shared across both instances (by viewing the login status of CRXDE on each instance).

However, we have encountered a critical error when attempting to login via the SAML Authentication Handler. After following the instructions (1) above, we SAML authenticate via Okta and we are met with the following error:


A fuller extract from the logs is as follows:

15.05.2019 22:59:45.428 ERROR [qtp192509136-4428] org.apache.felix.http.jetty Exception while processing request to /XXXXXXXXXXXXXX/saml_login (java.lang.SecurityException: com.adobe.granite.crypto.CryptoException: Cannot convert byte data)

java.lang.SecurityException: com.adobe.granite.crypto.CryptoException: Cannot convert byte data

at com.adobe.granite.keystore.internal.KeyStoreServiceImpl.extractStorePassword(

at com.adobe.granite.keystore.internal.KeyStoreServiceImpl.internalGetTrustStore(

at com.adobe.granite.keystore.internal.KeyStoreServiceImpl.getTrustStore(

at com.adobe.granite.auth.saml.SamlAuthenticationHandler.handleLogin(

at com.adobe.granite.auth.saml.SamlAuthenticationHandler.extractCredentials(







at org.apache.felix.http.base.internal.service.ServletContextImpl.handleSecurity(

at org.apache.felix.http.base.internal.dispatch.InvocationChain.doFilter(

at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(

at org.apache.felix.http.base.internal.DispatcherServlet.service(

at javax.servlet.http.HttpServlet.service(

at org.eclipse.jetty.servlet.ServletHolder.handle(

at org.eclipse.jetty.servlet.ServletHandler.doHandle(

at org.eclipse.jetty.server.session.SessionHandler.doHandle(

at org.eclipse.jetty.server.handler.ContextHandler.doHandle(

at org.eclipse.jetty.servlet.ServletHandler.doScope(

at org.eclipse.jetty.server.session.SessionHandler.doScope(

at org.eclipse.jetty.server.handler.ContextHandler.doScope(

at org.eclipse.jetty.server.handler.ScopedHandler.handle(

at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(

at org.eclipse.jetty.server.handler.HandlerWrapper.handle(

at org.eclipse.jetty.server.Server.handle(

at org.eclipse.jetty.server.HttpChannel.handle(

at org.eclipse.jetty.server.HttpConnection.onFillable(


at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(

at org.eclipse.jetty.util.thread.QueuedThreadPool$

at Source)

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

at com.adobe.granite.crypto.internal.CryptoSupportImpl.unprotect(

at com.adobe.granite.keystore.internal.KeyStoreServiceImpl.extractStorePassword(

... 32 common frames omitted

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

at com.adobe.granite.crypto.internal.CryptoSupportImpl.decrypt(

at com.adobe.granite.crypto.internal.CryptoSupportImpl.unprotect(

... 33 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(

at com.adobe.granite.crypto.internal.jsafe.JSafeCryptoSupport.getPlainText(

at com.adobe.granite.crypto.internal.CryptoSupportImpl.decrypt(

... 34 common frames omitted

One point to note, is that there is a key piece of detail missing from the instructions in (1), regarding where the /etc/key/ package should be built. Should it come from the common author instance or one of the publish instances? Either way, I know the problem goes deeper than that one concern but it should also be addressed.

All inputs gratefully received as ever.

4 Replies


Level 3

Thanks so much for jumping in Jaideep.

Our instance is 6.2 so we have to use the method described here: Encapsulated Token Support

Are you saying we can use the 6.3 method on 6.2?


Employee Advisor

Sorry, I misread the version number, if you are using 6.2 that's the correct article you are following.

There might be an issue with the Keystore.

Can you try to recreated the keystore.

Also, check if "cryptoservice" user has jcr:all rights on /etc/key