The way GoCD constructs the URLs for Git materials requires both username
and password to have non-empty values since all it does is just construct a
URL using these values
<https://github.com/gocd/gocd/blob/67fbd63486f5ac819c74e63996ee8ef7ba3763dd/domain/src/main/java/com/thoughtworks/go/config/materials/git/GitMaterial.java#L193-L206>
and invokes the command line git with this URL.

What's the error you get if you remove both username and path from URL (e.g
https://dev.azure.com/blah), put a dummy string in username, and the PAT in
password?

The docs at
https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows#use-a-pat
are a bit confusing to me. It's possible to interpret that as saying it's
not possible to use PATs on Azure DevOps with default Git URLs if Azure
requires the username to be empty/blank; since it talks about using a
custom constructed header with a blank username as a workaround (one that
wouldn't be possible via GoCD).

GoCD would be effectively doing the same as "git clone
https://dummyusername:p...@dev.azure.com/blah"; so if this doesn't work from
the command line, it might not be possible to make this work right now, and
unfortunately for some historic reasons GoCD doesn't classify the username
as "secret/secure" and so you can't put the PAT there either (in case that
works).

-Chad

On Mon, May 27, 2024 at 11:15 PM Obiageli Adegbite <oech...@gmail.com>
wrote:

> Hello,
>
> i am currently using gocd v19.8.0 and i want to connect to my Azure repo.
> When i put in my  credentials in the advanced settings the username and
> password(Personal Access Token(PAT)) and click connection it fails (pic1).
> However if i put it same PAT  in the repo url it works (pic2). The issue is
> the PAT is exposed. I also cannot use aws secret manager to hide the PAT in
> the repo url. If i don't want to use ssh is there something i am doing wrong
> [image: pic1.png]
>
> --
> You received this message because you are subscribed to the Google Groups
> "go-cd" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to go-cd+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/go-cd/14651c28-7e39-45b3-946f-f4705830e134n%40googlegroups.com
> <https://groups.google.com/d/msgid/go-cd/14651c28-7e39-45b3-946f-f4705830e134n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to go-cd+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/go-cd/CAA1RwH_5MfeCBzLqOW_wqEt7BgjaLH-OT%3DF6kLpCn%3Df-AKc7Dw%40mail.gmail.com.

Reply via email to