Authentication
Authentication
This guide explains how to authenticate with Source Push using the CLI.
Overview
Source Push provides multiple authentication methods:
- Browser-based authentication
- Access key authentication
- Token-based authentication
Browser-Based Authentication
The simplest way to authenticate is using your browser:
srcpush loginThis will:
- Open your default browser
- Redirect to the Source Push login page
- After successful login, generate an access token
- Store the token securely on your machine
Access Key Authentication
For CI/CD environments or headless systems, use access keys:
Creating an Access Key
srcpush access-key add "CI Server Key"Options:
--ttl <duration>- Specify key expiration (e.g., "30d", "1y")--description <text>- Add key description
Using an Access Key
srcpush login --accessKey <your-access-key>Or set the environment variable:
export SRCPUSH_ACCESS_KEY=<your-access-key>Managing Sessions
List Active Sessions
View all active sessions:
srcpush session lsRemove a Session
Remove a specific session:
srcpush session rm <machineName>Logout
End your current session:
srcpush logoutSecurity Best Practices
-
Access Key Management:
- Rotate access keys regularly
- Use short-lived keys when possible
- Never share keys between environments
-
Environment Security:
- Use environment variables in CI/CD
- Keep keys out of version control
- Use separate keys for different pipelines
-
Session Management:
- Regularly review active sessions
- Remove unused or suspicious sessions
- Logout from shared machines
Troubleshooting
Common Issues
-
Invalid Access Key:
srcpush access-key ls # Check if key is still valid srcpush access-key add "New Key" # Create new key if needed -
Session Expired:
srcpush logout srcpush login # Login again -
Network Issues:
# Use proxy if behind firewall srcpush login --proxy http://proxy.company.com
Error Messages
Authentication failed: Invalid credentials or expired tokenSession expired: Need to login againAccess denied: Insufficient permissions
CI/CD Integration
GitHub Actions
steps:
- name: Login to Source Push
run: srcpush login --accessKey ${{ secrets.SRCPUSH_ACCESS_KEY }}GitLab CI
deploy:
script:
- export SRCPUSH_ACCESS_KEY=$SRCPUSH_ACCESS_KEY
- srcpush login --accessKey $SRCPUSH_ACCESS_KEYJenkins Pipeline
environment {
SRCPUSH_ACCESS_KEY = credentials('srcpush-key')
}
steps {
sh 'srcpush login --accessKey $SRCPUSH_ACCESS_KEY'
}Advanced Configuration
Custom Server URL
For enterprise installations:
export SRCPUSH_SERVER_URL=https://srcpush.company.com
srcpush loginProxy Configuration
When behind a corporate firewall:
export SRCPUSH_PROXY=http://proxy.company.com:8080
srcpush loginNext Steps
After authentication: