-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
Description
Describe the bug
cannot get token to authenticate
To Reproduce
.net 7 app Using httpclient with UserDeaultCredentials set to falue
var client = ClientFactory.CreateClient("SuperAssociate");
HttpContent inputContent = new StringContent(GetEvent(), System.Text.Encoding.UTF8, "application/json");
DnsQuery.RegisterImplementation(new PlatformIndependentDnsClient());
var kClient = new KerberosClient();
var kerbCred = new KerberosPasswordCredential("XXXXXX", "YYYYYYY", "salelytics.local");
await kClient.Authenticate(kerbCred);
var ticket = await kClient.GetServiceTicket("host/webtest01.salelytics.local");
var apiHost = "http://webtest01.salelytics.local/";
Guard.Against.NullOrEmpty(apiHost);
client.BaseAddress = new Uri(apiHost);
var apiSite = "SuperAssociateRuss/api/IncomingEvent/";
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Negotiate", Convert.ToBase64String(ticket.EncodeGssApi().ToArray()));
var apiResponse = await client.PostAsync(apiSite, inputContent);
Expected behavior
The Authorization Header should validate as my user
The token I get from Kerbeoros.Net is different from the one my chrome browser is sending. should it be the same?