Re: Fwd: Git credentials not working
- From
Jeff King <peff@peff.net>
- Date
- Oct 3, 2018, 18:24 UTC
- Message-ID
- <20181003182409.GA14848@sigill.intra.peff.net>
- In-Reply-To
- <89f60502-c67d-83b6-593b-a0e6d8567183@gmail.com>
On Thu, Oct 04, 2018 at 01:12:11AM +0700, Dimitri Kopriwa wrote:
Show 8 quoted lines
> Thanks for your reply. I have activated GIT_TRACE_CURL=1 and I can see that > the request is failing 401. > > I can't see which token is used and using what header ? > > The log say: > > 17:50:26.414654 http.c:657 => Send header: Authorization: Basic <redacted>
Yeah, we redact the auth information so people don't accidentally share it publicly. If you use the older GIT_CURL_VERBOSE=1, it will include the credential (I think it may be base64 encoded, though, so you'll have to decipher it).
> I have retested the token locally and it work when used in the url or using > `Private-Token: <token>` as stated in the Gitlab documentation > https://docs.gitlab.com/ee/api/README.html#personal-access-tokens
I don't think Git will ever send your token in either of those ways. It will always some as an Authorization header.
> Peff, what would be the appropriate way to input my git credential in a 100% > success way in a CI?
I don't know the details of what GitLab would want, but...
Show 8 quoted lines
> Is this good: > > git credential approve <<EOF > protocol=https > host=example.com > username=bob > password=secr3t > OEF
Yes, that would work to preload a token into any configured helpers.
-Peff