I am facing problem with integrated windows authentication in excel. I have two server IIS 5 hosting legacy code(macro), and IIS 6 hosting new code. On client to avoid multiply credential dialog for each server I want user to be authenticated onl开发者_开发百科y on IIS 5. As a first step am authenticating user on IIS 5 using HttpWebRequest along with com CredUIPromptForCredentials. But even if this step authenticates the user on IIS 5 the legacy code(macro) when try to access IIS 5 shows up credential challenge dialog again.
here is how I am creating CredUIPromptForCredentials
CREDUI_FLAGS flags = CREDUI_FLAGS.ALWAYS_SHOW_UI | CREDUI_FLAGS.GENERIC_CREDENTIALS;
CredUIReturnCodes returnCode = CredUIPromptForCredentials(ref credUI, Application.ProductName, IntPtr.Zero, 0, userID, 100, userPassword, 100, ref save, flags);
request object
var authCredCache = new CredentialCache();
authCredCache.Add(new Uri(authServer), "Negotiate",
new NetworkCredential(user, pwd, domain));
httpWebRequest.Credentials = authCredCache;
精彩评论