Profiles
For each ODBC, Database or Extensible Source Connection RED maintains an in-memory credential set including the username, password, and connection string for each connection. This in-memory credential set is what we term the ‘Profile’ for authentication during the session of RED.
Additionally the Scheduler Configuration credentials are also stored in-memory for the session and included in the Profile when saving it to disk.
The in-memory profile is session based and therefore the credentials are specific to the user logged on during that session. The connection string itself is however stored in the metadata so that each RED user still uses the same authentication method as other users while in the RED UI.
Saving Profiles to Disk
Profiles can be saved to disk so that users need not enter usernames and passwords into each of their connections whenever they log in to RED.
To save a Profile including session passwords, right click on the Connections node in the objects tree and select 'Save Profile'
Select a name to save the file as and choose to Include Session Passwords. To ensure that all credentials are stored then make sure to open each connection and set the session credentials prior to saving the Profile.
Passwords encrypted at rest
Tips for Using OAuth or similar authentication methods
For some authentication methods you may need to use a script (or web browser) to login to a data source and generate an access token to use in your connection string. The access token could then be added in the Profile file as the password for a connection. If you have expiring tokens then you will need to create a script to refresh your tokens and restart your scheduler service to pick up the new tokens.
This would involve the following general steps to be implemented in a script:
- Log in to a server and get a new token (this should be a non-interactive process for the Scheduler).
- Encrypt the token with Windows DPAPI ensuring the script is running as the same Windows User as the scheduler service.
- Create a base64 Unicode string from the encrypted token
- Modify the Scheduler Profile file (which is in .JSON format) replacing the password on the affected connection with the base64 string.
- Restart the Scheduler service OR select ‘Poll for Status and Refresh Profile’ from RED for the Scheduler.
Example PowerShell script to create an encrypted base-64 Unicode string using Windows DPAPI:
If for some reason you need to decrypt the profile file passwords in a script the below method shows how to do this. Note that only the same Windows User that encrypted the password in the first place will be able to decrypt it.
Example PowerShell script to decrypt Windows DPAPI encrypted base64 Unicode string:
Example Profile file
The Profile file is a .JSON file which makes it easy to programmatically update any connection attributes it contains.
The following example has had passwords truncated for display purposes.