Using Client Secrets with IPM

Client secrets enable non-interactive authentication for automated processes. This guide explains how to use client secrets with the IPM client.

Prerequisites

Before using client secrets, ensure you have:

  • Created a client secret in the IPMHub portal
  • Required permissions for the intended operations
  • IPM client installed and configured

Enabling Non-Interactive Mode

To use client secrets, you must first enable non-interactive mode with the --non-interactive parameter. This tells IPM to use client secret authentication instead of interactive login.

Providing Client Secrets

There are two ways to provide client secrets to the IPM client:

1. Command Line Parameter

Use the --client-secrets parameter followed by your secret:

ipm add -p mycompany/mypackage --non-interactive --client-secrets YOUR_SECRET_HERE

2. Environment Variable

Set the IPM_CLIENT_SECRETS environment variable:

Linux/macOS:

export IPM_CLIENT_SECRETS=YOUR_SECRET_HERE
ipm add -p mycompany/mypackage --non-interactive

Windows:

set IPM_CLIENT_SECRETS=YOUR_SECRET_HERE
ipm add -p mycompany/mypackage --non-interactive

Using Multiple Client Secrets

You can provide multiple client secrets by separating them with spaces. This is useful when your automation requires different permission levels, potentially across multiple organizations:

ipm add -p mycompany/mypackage --non-interactive --client-secrets SECRET1 SECRET2

Or via environment variable (separating them by semicolons):

export IPM_CLIENT_SECRETS=SECRET1;SECRET2

Supported Commands

When using client secrets, only the following commands are available:

  • ipm add: Add and download packages
  • ipm sync: Sync a whole IPM workspace
  • ipm status: Get the status of a IPM workspace
  • ipm publish: Publish new package versions
  • ipm info: Retrieve package information

Security Best Practices

  1. Never commit client secrets to source control
  2. Use environment variables in CI/CD pipelines
  3. Rotate client secrets regularly
  4. Use secrets with minimal required permissions
  5. Monitor client secret usage through analytics

Common Issues

Authentication Failures

  • Verify the client secret is valid and not expired
  • Ensure the secret has appropriate permissions
  • Check for correct formatting when using multiple secrets

Command Availability

  • Confirm you’re using only supported commands
  • Verify the client secret has appropriate role (Viewer/Contributor)

Integration Problems

  • Enable non-interactive mode with --non-interactive
  • Check environment variable naming
  • Validate secret string format