SSO with pcdctl

Before you can use pcdctl with a single sign-on (SSO) user, you must first authenticate with Private Cloud Director Identity Service using the user credentials and generate a valid token. This is done by running the saml2pf9 utility, which handles the SSO authentication process and issues the token that pcdctl requires to execute commands on behalf of the authenticated user.

Currently, saml2pf9 is only supported with Microsoft Entra ID as an SSO Identity Provider (IDP).

Step 1: Download the saml2pf9 binary

Bash
Copy

Step 2: Configure SAML authentication for Entra ID

To configure authentication using CLI, execute the command saml2pf9 configure as shown below and follow the prompts to enter the required details. You can obtain the App ID directly from the Microsoft Entra ID Console.

Bash
Copy

Step 3: Generate a token

Now execute the saml2pf9 login command to log in to the identity service and generate a valid token.

Bash
Copy

After this step, the issued token is stored in a file located at $HOME/.pf9/credentials.

Step 4: Export environment variables

Export the generated token along with other mandatory environment variables by running the following:

This is required before you can run pcdctl commands

Bash
Copy

Now you should be able to run all pcdctl CLI commands while the token is valid.

Use saml2pf9 with automation

To automate the configuration and authentication

  1. Create a file named saml2pf9 in the $HOME/.pf9/ directory.
  2. Ensure that the file adheres to the required format outlined below.

When saml2pf9 is used, the system will authenticate using the settings defined in the configuration file.

Bash
Copy

To generate tokens in non-interactive scripts, provide the password as a command-line argument along with the --skip-prompt flag, as shown below:

Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated