Search code examples
owncloudnextcloud

How to see ldapAgentPassword of ldap configuration in plaintext


We have LDAP authentication configured in our owncloud and cannot remember the password for our ldap backend anymore. I have found the ldap_agent_password setting in the database which seems to store an encrypted string of that password.

How to display the password in plain text?


Solution

  • The ldap password isn't stored encrypted, instead it's only encoded with base64. To fetch it from the database use the following query:

    SELECT * FROM oc_appconfig WHERE appid='user_ldap' AND configkey='ldap_agent_password';
    

    Copy the configvalue and paste it in the following command:

    echo "VALUE" | base64 -d 
    

    For example if the query returns dGVzdDQyCg== execute:

    echo "dGVzdDQyCg==" | base64 -d 
    

    which will return test42.