hashicorp / hcp

HCP Command-Line Interface
Mozilla Public License 2.0
8 stars 0 forks source link

Invalid Grant Warning on running hcp #117

Open kartiklunkad26 opened 3 weeks ago

kartiklunkad26 commented 3 weeks ago

When I first upgraded to the hcp v0.3 binary, and I run hcp and get the below warning along with the help description. Is that expected?

I used brew install to do so, and I'm on a MacOS.


➜  workspace hcp
2024/06/18 06:30:38 failed to refresh the token: oauth2: "invalid_grant" "The provided authorization grant (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
USAGE
  hcp <command> [Optional Flags]

DESCRIPTION
  The HCP command-line interface (CLI) is a unified tool to manage your HCP
  services.

COMMAND GROUPS
  auth:           Authenticate to HCP.
  iam:            Manage identity and access management.
  organizations:  Interact with an existing organization.
  profile:        View and edit HCP CLI properties.
  projects:       Create and manage projects.
  vault-secrets:  Manage Vault Secrets.
  waypoint:       Manage HCP Waypoint.

COMMANDS
  version:  Display the HCP CLI version.

GLOBAL FLAGS
  --debug
    Enable debug output.

  --format=FORMAT
    Sets the output format.

  --profile=NAME
    The profile to use. If omitted, the currently selected profile will be used.

  --project=ID
    The HCP Project ID to use. If omitted the current project set in the
    configuration is used.

  --quiet
    Minimizes output and disables interactive prompting.
dadgar commented 2 weeks ago

Interesting. Did you by chance edit any files in ~/.config/hcp manually? Any other information you can share about steps you took before running the hcp command that relate to authenticating to hcp?

I was able to reproduce only by manually creating an invalid creds-cache.json.

Things I tried include: