Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

🔐 Auth: Seamless authentication using existing tools #10

Description

@jordanpartridge

Principle

Never ask for tokens that already exist on the system

Implementation

1. GitHub - Use gh CLI token

$token = trim(shell_exec('gh auth token 2>/dev/null'));
if (!$token && getenv('GITHUB_TOKEN')) {
    $token = getenv('GITHUB_TOKEN'); // Fallback only
}

2. Spotify - Multiple strategies

  • Check for existing Spotify app auth
  • Use saved refresh tokens
  • Only OAuth if absolutely needed

3. AWS/Cloud - Use existing configs

  • ~/.aws/credentials
  • gcloud auth
  • azure cli

Benefits

  • Zero config for most users
  • Inherit existing permissions
  • No token management
  • Works immediately after install

Anti-pattern to avoid

❌ "Create a PAT and add GITHUB_TOKEN to .env"
✅ "Using your existing gh authentication"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions