-
Notifications
You must be signed in to change notification settings - Fork 892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Too many redirects or authentication replays' on clone from TFS #1596
Comments
Did this work before? Have you tried creating a Personal Access Token instead of a bearer auth token? |
(Please also be sure to delete that access token, now that it’s been posted publicly.) |
No it never worked
Yes I tried PAT on TFS 2018 and same exception is occurring. |
I use PATs on TFS 2018 and VSTS with no problem. Can you show me some code or a fiddler or wireshark trace? |
Here is the code:
Fiddler trace: |
@ethomson waiting for your response. |
Hi @ethomson Using the blow code i am able to download the complete Repo (GitLab) _gitrepo = https://repo.mycompany.com/GPP/baseproject.git But i need to download/clone only selected folder from master branch, is that possible? (I am getting same error - Too many redirects or authentication replays) Code Snippet:
|
@satyaprakashv check the answer of your question here: |
@MustafaJamal , |
@MustafaJamal I was digging with this issue all the morning and this is a simple workaround if found with TFS 2018 Update 2 : LibGit2Sharp.Repository.Clone($"https://usercouldbeanything:{personalaccesstoken}@yourtfsserver/tfs/CollectionName/ProjectName/_git/GitRepoName", "GitRepoName"); If I use the basic auth UsernamePasswordCredentials with the same parameters : LibGit2Sharp.Repository.Clone("https://yourtfsserver/tfs/CollectionName/ProjectName/_git/GitRepoName", "GitRepoName", new CloneOptions()
{
CredentialsProvider = (_url, _user, _cred) =>
{
return new UsernamePasswordCredentials { Username = "usercouldbeanything", Password = personalaccesstoken };
}
}); I'm getting this exception :
@ethomson can it be a bug with the librairy? |
@ethomson waiting for your reply. Any update on this ? |
Had the same issue here. Turned out that if a wrong password was send once, the user account got locked. Normally in out IT we can enter the password three times, wrongly. |
@ethomson we are waiting for response |
I'm getting this on push using the github_actions bot token, which acts a bit weirdly because it's an integration. Any suggestions for that? I've tried a combination of
Using a regular PAT with a real username works as credentials, just fails for the github_actions token it seems. |
NuKeeper switched from version 0.26.2 to 0.27.0-preview-0034 and now I'm getting this error when trying to clone a repository from an Azure Devops Server 2019 instance. Reverting to 0.26.2 fixes the isssue. See NuKeeperDotNet/NuKeeper#1042 I will try to investigate the network traffic using wireshark next week. |
@rachkoud thank you for the this hint:
the code runs through without any exception but unfortunately if I then go to the local folder, I find it contains the items from the origin, but a |
I found the same issue. Reverting to 0.26.2 allowed me to checkout also. |
Ran into similar issues when trying to clone from an on premise Azure Devops Server 2020 into a docker container. We were able to get it working by doing the following while having Basic Authentication disabled. var token = "myPatToken";
var byteArray = Encoding.ASCII.GetBytes(":" + myPatToken);
var encodedToken = Convert.ToBase64String(byteArray);
var options = new CloneOptions
{
FetchOptions = new FetchOptions
{
CustomHeaders = new[]
{
$"Authorization: Basic {encodedToken}"
}
}
};
return Repository.Clone("https://...", ".", options); |
We use Any hints? Did change something in the API? |
Facing the same issue. |
At cognigy we are also facing this issue. It has been working for the last months without issues and started to break for us at the 12. of January. Any ideas of what we can change in order to fix this? |
Hi guys! This response might be surprising, but: |
Do you think, we could use a similar approach with |
If it's helpful, I am able to Clone, Pull, Push, everything in an AzureDevOps git repository with a personal access token (PAT) with Code (Read, Write, and Manage) permissions -- just supply the PAT as password for the username, empty string password in a UsernamePasswordCredentials object, and give that in the Credential Handler # credential provider:
public static CredentialsHandler GetDefaultCredentialsHandler(string projectName)
=> (_url, _user, _cred) => new UsernamePasswordCredentials
{
Username = personalAccessToken;
Password = string.Empty
};
# clone method:
var cloneOptions = new CloneOptions
{
CredentialsProvider = GetDefaultCredentialsHandler(this.ProjectName),
};
Repository.Clone(sourceURL, localClonePath, cloneOptions); |
Did anyone get this to work with Github and personal access tokens? Because I don't seem to get this done... |
Here's the credentials handler I use today. Seems to work fine: User/pass is user/token |
Mhm, strange. I did it the same way. Maybe the token is corrupt... |
I appreciate your approach, as it has successfully resolved the debugging process, which has been ongoing for days and weeks. Specifically, this approach has proven to be the most effective within my TFS DevOps environment. |
After updating to Team Foundation Server TFS 2018 & 2017 Update 3, we are not be able to login to GIT repository using LibGit2Sharp library using Access Token. Please check the code below:
I communicated with Microsoft TFS/VSTS Team they gave following response:
Please suggest, thanks in advance.
LibGit2Sharp version: 0.26.0-preview-0027
The text was updated successfully, but these errors were encountered: