[GH-ISSUE #269] Auth: Add auth validate command to test stored credentials #83

Closed
opened 2026-02-26 21:33:15 +03:00 by kerem · 1 comment
Owner

Originally created by @rudrankriyam on GitHub (Jan 28, 2026).
Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/269

Problem

Users currently have no way to verify that their stored credentials work without making an actual API call to a specific endpoint. If credentials become invalid (key revoked, issuer ID changed, key file moved), users only discover this when their intended operation fails. A dedicated validation command would help users troubleshoot authentication issues proactively.

Proposed Solution

Add a new auth validate subcommand that:

  1. Loads credentials from the configured source (keychain/config/env)
  2. Validates the private key can be loaded and parsed
  3. Generates a test JWT token
  4. Makes a lightweight API call to verify end-to-end authentication
  5. Reports detailed status for each validation step

Command signature:

asc auth validate [--profile <name>]

Example output for successful validation:

Validating credentials for profile: default

[PASS] Private key loaded from /path/to/key.p8
[PASS] Key file permissions are secure (0600)
[PASS] JWT token generated successfully
[PASS] API authentication successful

All checks passed. Credentials are valid.

Example output for failed validation:

Validating credentials for profile: default

[PASS] Private key loaded from /path/to/key.p8
[PASS] Key file permissions are secure (0600)
[PASS] JWT token generated successfully
[FAIL] API authentication failed: 401 Unauthorized

The credentials failed API validation. Possible causes:
- The API key may have been revoked in App Store Connect
- The Key ID or Issuer ID may be incorrect
- The private key may not match the registered public key

Visit https://appstoreconnect.apple.com/access/integrations/api to verify your key status.

Implementation Location

  • cmd/auth.go - Add the new validate subcommand
  • internal/auth/validate.go (new file) - Validation logic that can be reused by auth login

Acceptance Criteria

  • auth validate command validates the current profile or specified profile
  • Reports pass/fail status for each validation step
  • Provides actionable error messages with links to Apple documentation
  • Returns non-zero exit code on validation failure
  • Works with --profile flag to validate specific profiles
  • Add comprehensive tests for validation scenarios
Originally created by @rudrankriyam on GitHub (Jan 28, 2026). Original GitHub issue: https://github.com/rudrankriyam/App-Store-Connect-CLI/issues/269 ## Problem Users currently have no way to verify that their stored credentials work without making an actual API call to a specific endpoint. If credentials become invalid (key revoked, issuer ID changed, key file moved), users only discover this when their intended operation fails. A dedicated validation command would help users troubleshoot authentication issues proactively. ## Proposed Solution Add a new `auth validate` subcommand that: 1. Loads credentials from the configured source (keychain/config/env) 2. Validates the private key can be loaded and parsed 3. Generates a test JWT token 4. Makes a lightweight API call to verify end-to-end authentication 5. Reports detailed status for each validation step Command signature: ``` asc auth validate [--profile <name>] ``` Example output for successful validation: ``` Validating credentials for profile: default [PASS] Private key loaded from /path/to/key.p8 [PASS] Key file permissions are secure (0600) [PASS] JWT token generated successfully [PASS] API authentication successful All checks passed. Credentials are valid. ``` Example output for failed validation: ``` Validating credentials for profile: default [PASS] Private key loaded from /path/to/key.p8 [PASS] Key file permissions are secure (0600) [PASS] JWT token generated successfully [FAIL] API authentication failed: 401 Unauthorized The credentials failed API validation. Possible causes: - The API key may have been revoked in App Store Connect - The Key ID or Issuer ID may be incorrect - The private key may not match the registered public key Visit https://appstoreconnect.apple.com/access/integrations/api to verify your key status. ``` ## Implementation Location - `cmd/auth.go` - Add the new validate subcommand - `internal/auth/validate.go` (new file) - Validation logic that can be reused by `auth login` ## Acceptance Criteria - `auth validate` command validates the current profile or specified profile - Reports pass/fail status for each validation step - Provides actionable error messages with links to Apple documentation - Returns non-zero exit code on validation failure - Works with `--profile` flag to validate specific profiles - Add comprehensive tests for validation scenarios
kerem closed this issue 2026-02-26 21:33:15 +03:00
Author
Owner

@rudrankriyam commented on GitHub (Jan 28, 2026):

Closing per request. Reopen if any auth issues remain.

<!-- gh-comment-id:3813563915 --> @rudrankriyam commented on GitHub (Jan 28, 2026): Closing per request. Reopen if any auth issues remain.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/App-Store-Connect-CLI#83
No description provided.