How to retrieve LDAP password via JNDI

后端 未结 2 806
误落风尘
误落风尘 2021-01-03 05:42

I am able to read the password stored in LDAP via JNDI. But the result is some gibberish characters. So how do i decrypt it?

Below is my code:

public         


        
2条回答
  •  臣服心动
    2021-01-03 06:28

    with ldap we will get data in byte array.if you need to get the original password text use the
    following code:

    Attribute userPassword = attributes.get("userPassword");
    String pwd = new String((byte[]) userPassword.get());
    

提交回复
热议问题