adohkan/git-remote-https-iap

Failure to execute git commands due to bad request on refresh token

ryanm101 opened this issue · 0 comments

Expected Behavior

GIT_IAP_VERBOSE=1 git clone https://example.com/repo/repo.git
Cloning into 'repo'...
{"level":"debug","time":"2023-07-21T12:17:41+01:00","message":"/Users/me/bin/git-remote-https+iap origin https+iap://example.com/repo/repo.git"}
{"level":"debug","time":"2023-07-21T12:17:41+01:00","message":"[handleIAPAuthCookieFor] Manage IAP auth for https://example.comi"}
{"level":"debug","time":"2023-07-21T12:17:41+01:00","message":"[handleIAPAuthCookieFor] IAP Cookie still valid until 2023-07-21 13:17:22 +0100 BST"}
.....

Actual Behavior

GIT_IAP_VERBOSE=1 git-remote-https+iap check origin "https://example.com/repo/repo.git"
{"level":"debug","time":"2023-07-21T12:16:21+01:00","message":"git-remote-https+iap check origin https://example.com/repo/repo.git"}
{"level":"debug","time":"2023-07-21T12:16:21+01:00","message":"[handleIAPAuthCookieFor] Manage IAP auth for https://example.com"}
{"level":"debug","time":"2023-07-21T12:16:21+01:00","message":"[handleIAPAuthCookieFor] Could not read IAP cookie for https://example.com: open /Users/me/.config/gcp-iap/example.com.cookie: no such file or directory"}
{"level":"debug","time":"2023-07-21T12:16:21+01:00","message":"[NewCookie] Attempting to get NewCookie"}
{"level":"debug","time":"2023-07-21T12:16:21+01:00","message":"[GetCredentials] Found credentials for protocol=iap,host=https://example.com,username=refresh-token"}
{"level":"debug","time":"2023-07-21T12:16:21+01:00","message":"[GetIAPAuthToken] refreshToken is: XXXXXXXX"}
{"level":"debug","time":"2023-07-21T12:16:21+01:00","message":"[GetIAPAuthToken] Google Endpoint is: https://oauth2.googleapis.com/token"}
{"level":"debug","time":"2023-07-21T12:16:22+01:00","message":"[NewCookie] Failed to GetIAPAuthToken"}
{"level":"fatal","time":"2023-07-21T12:16:22+01:00","message":"[GetIAPAuthToken] Could not get exchange 'refresh_token' for IAP Auth Token: HTTP Error Code: Bad Request .... Error Description: invalid_grant"}

Steps to Reproduce the Problem

Unsure.
I suspect issue with the fact the browserflow never executes so I have a corrupted cached cred.

Specifications

  • Version: 0.20
  • Git version: 2.39.2
  • Operating System: Mac (M1) Ventura 13.4.1