Using Client Secrets
How to use client secrets with the IPM client
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 packagesipm sync
: Sync a whole IPM workspaceipm status
: Get the status of a IPM workspaceipm publish
: Publish new package versionsipm info
: Retrieve package information
Security Best Practices
- Never commit client secrets to source control
- Use environment variables in CI/CD pipelines
- Rotate client secrets regularly
- Use secrets with minimal required permissions
- 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