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.

Note

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

Step 1: Download the saml2pf9 binary

sudo curl -shttps://pcdctl.s3.us-west-2.amazonaws.com/saml2pf9 -o /usr/bin/saml2pf9

# To ensure that the downloaded file is executable, run the following command:
sudo chmod +x /usr/bin/saml2pf9

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.

root@host1:$ saml2pf9 configure

? Please choose a provider: AzureAD

? Please choose an MFA Auto

? PF9 URL https://<DU_FQDN>

? PF9 Tenant Id <Tenant ID>

? Username [email protected]

? IDP IDP1

? App ID <App ID>

Step 3: Generate a token

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

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

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.

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

Last updated

Was this helpful?