Access Tokens
Access tokens authenticate Composer clients with your Pricore instance. They provide secure, revocable access to your private packages.
Token Types
Pricore supports two types of tokens:
Organization Tokens
- Created by organization members
- Grant access only to packages within that organization
- Ideal for CI/CD pipelines and shared access
- Managed in Organization Settings > Composer Tokens
Personal Tokens
- Created by individual users
- Grant access across all organizations the user belongs to
- Ideal for local development
- Managed in Settings > Personal Tokens
Creating Tokens
Organization Token
- Navigate to Organization Settings > Composer Tokens
- Click Create Token
- Enter a descriptive name (e.g., "CI Pipeline", "Production Deploy")
- Select an expiration period (never, 30 days, 90 days, or 1 year)
- Click Create
- Copy the token immediately — it won't be shown again
Personal Token
- Go to Settings > Personal Tokens
- Click Create Token
- Enter a name for the token
- Select an expiration period
- Click Create
- Copy and store the token securely
After creation, a dialog shows the plain token along with a pre-filled Composer command you can copy directly.
Token Scopes
| Scope | Permission |
|---|---|
read | Read-only access to packages |
write | Upload and modify packages |
admin | Administrative access |
Using Tokens with Composer
When you create a token, Pricore shows the exact Composer command to configure authentication. The format is:
composer config --global --auth http-basic.pricore.yourcompany.com token YOUR_ACCESS_TOKENThis creates or updates ~/.composer/auth.json:
{
"http-basic": {
"pricore.yourcompany.com": {
"username": "token",
"password": "YOUR_ACCESS_TOKEN"
}
}
}Project Configuration
For project-specific tokens, create auth.json in your project root:
{
"http-basic": {
"pricore.yourcompany.com": {
"username": "token",
"password": "YOUR_ACCESS_TOKEN"
}
}
}WARNING
Add auth.json to your .gitignore to avoid committing tokens to version control.
Environment Variables
For CI/CD, use environment variables:
export COMPOSER_AUTH='{"http-basic":{"pricore.yourcompany.com":{"username":"token","password":"'"$PRICORE_TOKEN"'"}}}'Or in your CI configuration:
# GitHub Actions example
- name: Configure Composer
run: |
composer config --global --auth http-basic.pricore.yourcompany.com token ${{ secrets.PRICORE_TOKEN }}Token Security
Best Practices
- Use descriptive names — Know what each token is used for
- Set expiration dates — Rotate tokens regularly
- Use organization tokens for CI/CD — Limit access to a single organization
- Use personal tokens for development — Convenient access across all your organizations
- Never commit tokens — Use environment variables or secrets management
Revoking Tokens
To revoke a token:
- Go to the token list (Organization Settings or Personal Settings)
- Find the token to revoke
- Click Revoke
- Confirm the action
Revoked tokens immediately stop working. Update any systems using the token.
Token Audit
Monitor token usage:
- Last Used — When the token was last used
- Created — When the token was created
- Expires — When the token will expire (if set)
Regular audits help identify:
- Unused tokens that should be revoked
- Tokens used more frequently than expected
- Tokens approaching expiration
CI/CD Integration
GitHub Actions
name: Install Dependencies
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
- name: Configure Pricore
run: composer config --global --auth http-basic.pricore.yourcompany.com token ${{ secrets.PRICORE_TOKEN }}
- name: Install dependencies
run: composer installGitLab CI
install:
stage: build
before_script:
- composer config --global --auth http-basic.pricore.yourcompany.com token $PRICORE_TOKEN
script:
- composer installBitbucket Pipelines
pipelines:
default:
- step:
script:
- composer config --global --auth http-basic.pricore.yourcompany.com token $PRICORE_TOKEN
- composer installTroubleshooting
Authentication Failed
- Verify the token is correct (no extra spaces)
- Check that the token hasn't been revoked or expired
- Verify the domain in
auth.jsonmatches your Pricore URL - Ensure the token is used as the password (not the username)
Token Not Working for Specific Package
- If using an organization token, verify the package belongs to that organization
- If using a personal token, verify your organization membership
- Ensure the package exists and is accessible
Token Expired
- Check the token's expiration date in your settings
- Create a new token if expired
- Update all systems using the old token