Special characters in the password causes edge-ui login failures

Problem Statement:

If you are using external ldap authentication and your ldap password has special characters then this article is helpful.

In case if you changed your ldap password and/or if you are following doc link about Configuration required for different sysadmin credentials then there is following step:

Encrypt the user ID and password:
> java -cp "/opt/apigee/edge-ui/conf:/opt/apigee/edge-ui/lib/*" utils.EncryptUtil userName:PWord

Here if there is special character in the password then edge-ui login fail with following error in the edge-ui.log:

Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
	at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:989)
	at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:845)
	at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446)
	at javax.crypto.Cipher.doFinal(Cipher.java:2165)
	at play.api.libs.Crypto.decryptAESVersion0(Crypto.scala:521)
	at play.api.libs.Crypto.decryptAES(Crypto.scala:497)
	at play.api.libs.Crypto.decryptAES(Crypto.scala:474)
	at play.libs.Crypto.decryptAES(Crypto.java:179)
	at utils.SetupHelper.decrypt(SetupHelper.java:14)
	at utils.SetupHelper.user(SetupHelper.java:21)
	at services.ConfigService$Management.<clinit>(ConfigService.java:49)
	... 43 more

Solution:

To fix this encrypt the user ID and password with single quote around as follows and follow all the other steps on the doc:

java -cp "/opt/apigee/edge-ui/conf:/opt/apigee/edge-ui/lib/*" utils.EncryptUtil 'userName:PWord'
Version history
Last update:
‎04-25-2018 02:07 PM
Updated by: