Hi All,
public class BasicAuthenticationFilter : IHttpRequestHeaderFilter { private string _authToken; public BasicAuthenticationFilter(NetworkCredential userCredential) { _authToken = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}:{2}",userCredential.UserName, userCredential.Password,
userCredential.Domain
))); } public HttpRequestHeaders ProcessHeaders(HttpRequestHeaders headers) { headers.Authorization = new AuthenticationHeaderValue("Basic", _authToken); return headers; } }
Code like this:new NetworkCredential("myuseranme", "mypwd", "mydomain")
I need to access TFS rest API. But i still geting the issue when i request the uri and set httpclilent heads value:
“You do not have permission to view this directory or page using the credentials that you supplied.”
anybody know this? thanks
Code:
https://vsorest.codeplex.com/discussions/587525
True mastery of any skill takes a lifetime.