I am going to be using a Symfony SMB Bundle like this to browse a Windows File System through PHP.
To do this - I'll create a Web API that will return a list of files and directories in a directory so you can browse through the contents of a network share.
As I'll need to authenticate with LDAP each time I make the connection, what is the best way to send the LDAP username and password of the user each time?
Is it safe to store a private key on the server in a database against the username, that is used to encrypt a string e.g. (username:password:timestamp:ipaddress) and then have the client sends that encrypted string with each request using HTTPS for the server to then decrypt and use the credentials - after each request the private key will be changed. If the timestamp has expired it'll reject it, if the IP address does not match it'll reject it etc.
Or is there a better / more secure way to authenticate with credentials each time without the user having to re-enter for every request?