Skip to main content

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 login

This will:

  1. Open your default browser
  2. Redirect to the Source Push login page
  3. After successful login, generate an access token
  4. 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 ls

Remove a Session

Remove a specific session:

srcpush session rm <machineName>

Logout

End your current session:

srcpush logout

Security Best Practices

  1. Access Key Management:

    • Rotate access keys regularly
    • Use short-lived keys when possible
    • Never share keys between environments
  2. Environment Security:

    • Use environment variables in CI/CD
    • Keep keys out of version control
    • Use separate keys for different pipelines
  3. Session Management:

    • Regularly review active sessions
    • Remove unused or suspicious sessions
    • Logout from shared machines

Troubleshooting

Common Issues

  1. Invalid Access Key:

    srcpush access-key ls # Check if key is still valid
    srcpush access-key add "New Key" # Create new key if needed
  2. Session Expired:

    srcpush logout
    srcpush login # Login again
  3. Network Issues:

    # Use proxy if behind firewall
    srcpush login --proxy http://proxy.company.com

Error Messages

  • Authentication failed: Invalid credentials or expired token
  • Session expired: Need to login again
  • Access 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_KEY

Jenkins 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 login

Proxy Configuration

When behind a corporate firewall:

export SRCPUSH_PROXY=http://proxy.company.com:8080
srcpush login

Next Steps

After authentication:

  1. Create your first app
  2. Learn CLI commands
  3. Set up CI/CD integration