You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Scripted Authentication can be enabled for a connection by providing a command line to run in the 'Auth Script Command' field. This command will be triggered by RED when it needs to authenticate with this connection for the first time and then again whenever the 'Auth Expires After' minutes is exceeded.

Typical Script Based Authentication Workflow

When RED executes the 'Auth Script Command' this is the typical workflow: 

  1. RED UI
    1. Save the current RED Profile to disk and provide access to this Profile file and the connection name requiring authentication via environment variables.
    2. Run the 'Auth Script Command'
  2. Authentication Script
    1. Reads the RED Profile and retrieves any required Connection details from it.
    2. Perform the required authentication workflow for the connection.
    3. Updates the RED Profile on disk with refreshed Auth Tokens and other Auth Configuration values as required. 
  3. RED UI
    1. Merges the updated RED Profile file back into memory.
    2. Completes the authentication process for the connection.
    3. Resets the internal expiry for the connection based on 'Auth Expires After' mins. 

Environment Variables for Authentication Scripts

RED will set the following Environment Variables for the Auth Script Command execution.

These are the minimum set that can be relied on, but the usual WSL_TGT_* and WSL_META_* variables will also be provided if available for the scenario. WSL_TGT_* vars are set to the context of the connection being authenticated to. In any script that relies on other variables to be set it is best to fall back to extracting from the Profile file when these are not set in the environment.

Environment VariableValueDescription
WSL_TGT_CONNAME

The name of the connection being refreshed.

Not set for the Metadata Repository connection.

Determines which connection requires authentication and the node to update in the profile file.

When not set then authenticate the Metadata Repository which is at the root node of the profile. 

WSL_RED_PROFILEThe path to the RED Profile file.Used to read and then update the RED Profile file, as required, for the particular authentication flow
WSL_BINDIRThe path to the RED installation directory.Useful if your scripts utilize any RED command line tooling.

RED Login with the 'Auth Script Command'


No files shared here yet.


  • No labels