嗨,我需要检查siteminder的状态,看看它是否已关闭。我目前的解决方案是在指定环境中ping siteminder的策略服务器。有没有办法检查Siteminder是否使用c#启动或关闭?提前致谢
答案 0 :(得分:0)
我将此代码转储到google doc中,当时我正在使用siteminder的项目。希望它有所帮助
String urltest = "https://domain/authentication.fcc?target=https://domain/desired/stats/page.asp";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(urltest);
CredentialCache MyCredentialCache = new CredentialCache();
MyCredentialCache.Add(new Uri(uriTeste), "NTLM", new NetworkCredential("user", "password", "domain"));
req.Credentials = MyCredentialCache;
req.PreAuthenticate = false;
req.AllowAutoRedirect = true;
req.UnsafeAuthenticatedConnectionSharing = true;
req.Method = "POST";
req.Timeout = 100000;
HttpWebResponse rsp = (HttpWebResponse)req.GetResponse();