
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Command-line tool for managing PingOne resources via the PingOne Management API.
executeRequest, executeCachedRequest, and executeVoidRequest# Install globally
npm install -g p1-cli
# Or use with npx (no installation required)
npx p1-cli --help
# Clone the repository
git clone https://github.com/ryanbas21/ping-cli
cd ping-cli
# Install dependencies
pnpm install
# Build the CLI
pnpm --filter 'p1-cli' build
# Link for local development
cd packages/ping-cli
npm link
Node.js: Version 18.x or higher recommended
Optional: Native Keychain Support (for secure credential storage)
The CLI uses keytar for secure credential storage in system keychains:
libsecret)Installing on Linux (for keychain support):
# Debian/Ubuntu
sudo apt-get install libsecret-1-dev
# Red Hat/Fedora
sudo yum install libsecret-devel
# Arch Linux
sudo pacman -S libsecret
Note: If keytar is unavailable or keychain access fails, the CLI automatically falls back to:
~/.ping-cli/credentials.enc) - Suitable for development/testingSee OAUTH_SETUP.md for detailed credential storage information.
The PingOne CLI supports OAuth 2.0 Client Credentials flow for secure, automatic token management.
p1-cli auth login \
--client-id="your-client-id" \
--client-secret="your-client-secret" \
--environment-id="your-environment-id" \
--region="com"
Or use interactive mode (CLI will prompt for missing values):
p1-cli auth login
p1-cli auth status
# Authentication flags are optional when you've logged in
p1-cli list_users --environment-id="your-env-id"
# Or with stored credentials, environment ID is optional too if set via env var
export PINGONE_ENV_ID="your-env-id"
p1-cli list_users
For complete setup instructions including PingOne Worker Application configuration, see OAUTH_SETUP.md.
Note: After running auth login, you don't need to provide --pingone-token flags - the CLI automatically manages tokens for you.
The CLI supports three authentication methods with automatic fallback priority:
Store credentials once, tokens are managed automatically:
# Store credentials
p1-cli auth login --client-id="..." --client-secret="..." --environment-id="..." --region="com"
# Use CLI commands (no token needed)
p1-cli users list --environment-id="your-env-id"
Benefits:
Set credentials via environment variables for CI/CD:
# For OAuth (preferred)
export PINGONE_CLIENT_ID="your-client-id"
export PINGONE_CLIENT_SECRET="your-client-secret"
export PINGONE_ENV_ID="your-environment-id"
# Optional: Configure token expiration buffer (default: 300 seconds / 5 minutes)
export PINGONE_TOKEN_BUFFER_SECONDS="60"
# Legacy: Direct token (still supported)
export PINGONE_TOKEN="your-access-token"
export PINGONE_ENV_ID="your-environment-id"
# Use CLI
p1-cli users list
Benefits:
Provide authentication per-command:
p1-cli users list \
--environment-id="your-env-id" \
--pingone-token="your-access-token"
Benefits:
The CLI checks authentication in this order:
--pingone-token CLI flag (if provided)PINGONE_TOKEN environment variableauth login)If none are available, the CLI will prompt you to run p1-cli auth login.
For automated environments (GitHub Actions, GitLab CI, etc.):
# Example: GitHub Actions
env:
PINGONE_CLIENT_ID: ${{ secrets.PINGONE_CLIENT_ID }}
PINGONE_CLIENT_SECRET: ${{ secrets.PINGONE_CLIENT_SECRET }}
PINGONE_ENV_ID: ${{ secrets.PINGONE_ENV_ID }}
steps:
- name: List Users
run: p1-cli users list
Security Best Practices:
Optional configuration via environment variables:
# Optional: PingOne API Base URL (defaults to North America)
PINGONE_API_URL=https://api.pingone.com/v1
# Optional: Default population ID
PINGONE_POPULATION_ID=your-default-population-id
The CLI automatically configures the correct API endpoint based on the region you specify during auth login. The API URL is determined using this priority:
PINGONE_API_URL environment variable - Explicitly set URL (highest priority)When you run auth login with a region:
p1-cli auth login --region="ca"
# Automatically uses: https://api.pingone.ca/v1 for all API calls
No manual configuration needed! The CLI automatically extracts the region from your stored credentials and uses the correct API endpoint.
Available Regions:
https://api.pingone.com/v1https://api.pingone.eu/v1https://api.pingone.asia/v1https://api.pingone.ca/v1Manual Override (Optional):
# Override the API URL for testing or custom deployments
export PINGONE_API_URL="https://api.pingone.eu/v1"
Once authenticated with p1-cli auth login, most commands can be run with minimal flags:
# Set your environment ID once (optional but convenient)
export PINGONE_ENV_ID="your-environment-id"
# Now commands are simple
p1-cli list_users
p1-cli create_user john.doe john@example.com --population-id="pop-123"
p1-cli groups list_groups
p1-cli populations list_populations
# Authentication flags (--pingone-token) are automatically handled
# Environment ID flag (--environment-id) is optional if PINGONE_ENV_ID is set
All examples below show explicit flags for clarity, but remember:
--pingone-token is optional when you've run auth login--environment-id is optional when PINGONE_ENV_ID environment variable is setManage OAuth authentication and view authentication status:
# Login with OAuth client credentials
p1-cli auth login \
--client-id="your-client-id" \
--client-secret="your-client-secret" \
--environment-id="your-environment-id" \
--region="com"
# Login with interactive prompts
p1-cli auth login
# Check authentication status
p1-cli auth status
# Logout (clear stored credentials)
p1-cli auth logout
Authentication Status Output:
✓ Authenticated
Client ID: 12345678****abcd
Environment: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
✓ Access token is valid
Expires: 1/10/2025, 3:30:00 PM
Discover and manage PingOne environments. These commands help you find your environment ID, which is required for other CLI operations.
# List all environments your token has access to
p1-cli environments list_environments \
--pingone-token <token>
# List environments with pagination
p1-cli environments list_environments \
--pingone-token <token> \
--limit 10
# List environments with filter (production only)
p1-cli environments list_environments \
--pingone-token <token> \
--filter 'type eq "PRODUCTION"'
# List environments with filter (sandbox only)
p1-cli environments list_environments \
--pingone-token <token> \
--filter 'type eq "SANDBOX"'
# List environments by region
p1-cli environments list_environments \
--pingone-token <token> \
--filter 'region eq "NA"'
# List environments by name (contains)
p1-cli environments list_environments \
--pingone-token <token> \
--filter 'name sw "Dev"'
# Read a specific environment by ID
p1-cli environments read_environment <environment-id> \
--pingone-token <token>
Filter Operators:
eq - Equals (exact match)ne - Not equalssw - Starts withew - Ends withco - Containsand - Logical ANDor - Logical ORPagination Limitations:
--limit parameter controls the maximum number of results returned in a single requestNote: Environment commands only require a --pingone-token (not an --environment-id) since they operate at the organization level.
# Create a user
p1-cli create_user <username> <email> \
--environment-id <env-id> \
--pingone-token <token> \
--population-id <pop-id> \
--given-name "John" \
--family-name "Doe"
# Read a user
p1-cli read_user <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# Update a user (accepts JSON data)
p1-cli update_user <user-id> <json-data> \
--environment-id <env-id> \
--pingone-token <token>
# Update user example
p1-cli update_user abc123 '{"email":"newemail@example.com"}' \
--environment-id <env-id> \
--pingone-token <token>
# Delete a user
p1-cli delete_user <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# Verify a user with a verification code
p1-cli verify_user <user-id> <verification-code> \
--environment-id <env-id> \
--pingone-token <token>
# List users with optional filtering
p1-cli list_users \
--environment-id <env-id> \
--pingone-token <token> \
--limit 20 \
--filter 'email eq "john@example.com"'
Control user account status and authentication capabilities:
# Enable a user account
p1-cli enable_user <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# Disable a user account
p1-cli disable_user <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# Lock a user account (prevents authentication)
p1-cli lock_user <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# Unlock a user account (allows authentication)
p1-cli unlock_user <user-id> \
--environment-id <env-id> \
--pingone-token <token>
Note: Lock/unlock controls the account.canAuthenticate flag, while enable/disable controls the enabled flag.
Manage user passwords with set, reset, and recovery operations:
# Set a user's password directly (admin operation)
p1-cli set_password <user-id> <password> \
--environment-id <env-id> \
--pingone-token <token>
# Set password and force change on next login
p1-cli set_password <user-id> <password> \
--environment-id <env-id> \
--pingone-token <token> \
--force-change
# Reset password (admin-initiated, sends reset email)
p1-cli reset_password <email> \
--environment-id <env-id> \
--pingone-token <token>
# Recover password (self-service, sends recovery email)
p1-cli recover_password <email> \
--environment-id <env-id> \
--pingone-token <token>
Note:
set_password - Direct password change by administratorreset_password - Admin-initiated password reset flow (sends email)recover_password - Self-service password recovery flow (sends email)Manage multi-factor authentication for users:
# Enable MFA for a user
p1-cli enable_mfa <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# Disable MFA for a user
p1-cli disable_mfa <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# List MFA devices for a user
p1-cli list_mfa_devices <user-id> \
--environment-id <env-id> \
--pingone-token <token> \
--limit 10
# Delete a specific MFA device
p1-cli delete_mfa_device <user-id> <device-id> \
--environment-id <env-id> \
--pingone-token <token>
Manage and monitor user sessions:
# List active sessions for a user
p1-cli list_sessions <user-id> \
--environment-id <env-id> \
--pingone-token <token> \
--limit 10
# Revoke a specific session
p1-cli revoke_session <user-id> <session-id> \
--environment-id <env-id> \
--pingone-token <token>
Note: Session management is useful for security operations like force logout or investigating active sessions.
Efficiently manage large numbers of users with bulk operations supporting CSV and JSON formats.
Import users from a CSV or JSON file with parallel processing:
# Import from CSV (default format)
p1-cli bulk_import_users users.csv \
--environment-id <env-id> \
--pingone-token <token> \
--format csv
# Import from JSON
p1-cli bulk_import_users users.json \
--environment-id <env-id> \
--pingone-token <token> \
--format json
# Dry-run mode (preview without creating users)
p1-cli bulk_import_users users.csv \
--environment-id <env-id> \
--pingone-token <token> \
--dry-run
# Control concurrency (default: 5 parallel operations)
p1-cli bulk_import_users users.csv \
--environment-id <env-id> \
--pingone-token <token> \
--concurrency 10
CSV Format Example:
username,email,populationId,givenName,familyName,department
john.doe,john@example.com,pop-123,John,Doe,Engineering
jane.smith,jane@example.com,pop-123,Jane,Smith,Sales
JSON Format Example:
[
{
"username": "john.doe",
"email": "john@example.com",
"populationId": "pop-123",
"givenName": "John",
"familyName": "Doe",
"department": "Engineering"
},
{
"username": "jane.smith",
"email": "jane@example.com",
"populationId": "pop-123",
"givenName": "Jane",
"familyName": "Smith",
"department": "Sales"
}
]
Export users to CSV or JSON format:
# Export all users to CSV
p1-cli bulk_export_users users.csv \
--environment-id <env-id> \
--pingone-token <token> \
--format csv
# Export to JSON
p1-cli bulk_export_users users.json \
--environment-id <env-id> \
--pingone-token <token> \
--format json
# Export with filter
p1-cli bulk_export_users active-users.csv \
--environment-id <env-id> \
--pingone-token <token> \
--filter 'enabled eq true' \
--limit 1000
Delete multiple users from a file containing user IDs:
# Delete users (requires --confirm flag for safety)
p1-cli bulk_delete_users user-ids.csv \
--environment-id <env-id> \
--pingone-token <token> \
--confirm
# Dry-run mode (preview without deleting)
p1-cli bulk_delete_users user-ids.csv \
--environment-id <env-id> \
--pingone-token <token> \
--dry-run
# Control concurrency for rate limiting
p1-cli bulk_delete_users user-ids.csv \
--environment-id <env-id> \
--pingone-token <token> \
--confirm \
--concurrency 3
CSV Format for Deletion:
userId
abc-123-def
xyz-456-ghi
Bulk Operations Features:
# Create a group
p1-cli groups create_group <name> \
--environment-id <env-id> \
--pingone-token <token> \
--description "Group description"
# Read a group
p1-cli groups read_group <group-id> \
--environment-id <env-id> \
--pingone-token <token>
# List all groups
p1-cli groups list_groups \
--environment-id <env-id> \
--pingone-token <token> \
--limit 10
# Update a group
p1-cli groups update_group <group-id> \
--environment-id <env-id> \
--pingone-token <token> \
--name "New Name"
# Delete a group
p1-cli groups delete_group <group-id> \
--environment-id <env-id> \
--pingone-token <token>
# Add a member to a group
p1-cli groups add_member <group-id> <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# Remove a member from a group
p1-cli groups remove_member <group-id> <user-id> \
--environment-id <env-id> \
--pingone-token <token>
# List group members
p1-cli groups list_members <group-id> \
--environment-id <env-id> \
--pingone-token <token>
# Create a population
p1-cli populations create_population <name> \
--environment-id <env-id> \
--pingone-token <token> \
--description "Population description"
# Read a population
p1-cli populations read_population <population-id> \
--environment-id <env-id> \
--pingone-token <token>
# List all populations
p1-cli populations list_populations \
--environment-id <env-id> \
--pingone-token <token>
# Update a population
p1-cli populations update_population <population-id> \
--environment-id <env-id> \
--pingone-token <token> \
--name "New Name"
# Delete a population
p1-cli populations delete_population <population-id> \
--environment-id <env-id> \
--pingone-token <token>
# Create an application
p1-cli applications create_application <name> \
--environment-id <env-id> \
--pingone-token <token> \
--description "App description" \
--type "WEB_APP"
# Read an application
p1-cli applications read_application <application-id> \
--environment-id <env-id> \
--pingone-token <token>
# List all applications
p1-cli applications list_applications \
--environment-id <env-id> \
--pingone-token <token>
# Update an application
p1-cli applications update_application <application-id> \
--environment-id <env-id> \
--pingone-token <token> \
--name "New Name"
# Delete an application
p1-cli applications delete_application <application-id> \
--environment-id <env-id> \
--pingone-token <token>
Some CLI commands require additional OAuth scopes that may not be granted by default to Worker Applications in PingOne:
UPDATE Operations - Require update scopes:
update_user - Requires update:users scopegroups update_group - Requires update:groups scopepopulations update_population - Requires update:populations scopeapplications update_application - Requires update:applications scopeUser State Operations - Require user:updateStatus scope:
enable_user, disable_user - Control user enabled statuslock_user, unlock_user - Control authentication capabilityenable_mfa, disable_mfa - Control MFA settingsset_password, reset_password, recover_password - Password operationsTroubleshooting:
If you receive 403 Forbidden or 400 Bad Request errors for these operations:
p1-cli auth logout and p1-cli auth login to get a fresh token with new scopesWorking Operations (available with default Worker Application permissions):
For detailed information about the internal architecture, service composition, and design patterns, see:
The CLI provides clear error messages to help troubleshoot issues:
p1-cli auth login to authenticate.If you encounter errors:
p1-cli auth status to verify you're authenticatedFor detailed error type information for developers, see CONTRIBUTING.md
Want to contribute? See CONTRIBUTING.md for development setup, testing, and contribution guidelines
MIT
⚠️ IMPORTANT: This is completely unsupported and is NOT an official release of a Ping product. This tool is provided as-is for development and testing purposes only. Use at your own risk.
FAQs
A CLI tool for managing PingOne resources
The npm package p1-cli receives a total of 0 weekly downloads. As such, p1-cli popularity was classified as not popular.
We found that p1-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.