I have the following line of code in a python script to bind to LDAP using my credentials(assuming username is "abcdef", and password is "123456":
l.simple_bind_s("domain\abcdef", "123456")
Works fine when I run the script and do queries.
However, how can I replace the hardcoded credentials to be read from a JSON file instead?
I currently wrote this JSON file and named it creds.json:
{
"username": "domain\\abcdef",
"password": "123456"
}
Im new to coding, and any help would be great to be able to import the credentials to my python script that are stored in a json file. What would i need to do to the python script to make this work?
thanks in advance!