I have Node.js server which serves an app. In that app you could be asked to login. The login credentials would be authenticated against LDAP.
That server could request/post data from other servers via REST. Those restful endpoints could be secured with basic auth against the same LDAP server.
Is it safe to encrypt
<username>:<password> and store this in the session on the Node.js server and, on request, decrypt those credentials and pass them in the Basic Auth header value to the restful endpoint?
The encryption key would be randomly created for that session and then destroyed at the end of the session. The credentials only live for the period of a session as well.