I have a C# client s below. I need to generate a kerberos token using this ticket. But it is always generating a NTLM token. The KDC is AD.
public static void Main(string[] args)
{
Uri uri = new Uri(args[0]);
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(uri);
req.Credentials = CredentialCache.DefaultCredentials;
// Get the response.
using (HttpWebResponse res = (HttpWebResponse)req.GetResponse())
{
StreamReader sr = new StreamReader(res.GetResponseStream());
Console.WriteLine(sr.ReadToEnd());
}
}
The generated token is "Negotiate TlRMTVNTUAABAAAAl7II4gIAAgAuAAAABgAGACgAAAAGAvAjAAAAD1NFUlZFUklT". Can anybody instruct me what are the changes we should do to generate a kerberos ticket instead of NTLM one.
Thanks
Before for the URL I have used the IP address. After using host name instead of IP address I could able to solve the problem