0
siteminder로 보호되는 WCF 웹 서버를 사용하려고합니다. 문제는 브라우저에서 웹 서비스 URL을 탐색하려고 할 때 내가 제공 한 자격 증명을 사용하여 올바르게 작동하는 것입니다.siteminder가 보호 된 WCF 서비스 C#
하지만 프로그래밍 방식으로 동일한 작업을 수행하려고하면 오류 # # 401이 무단으로 전송됩니다. 참조
- http://www.codeproject.com/Articles/80314/How-to-Connect-to-a-SiteMinder-Protected-Resource CookieContainer cookies = null;
HttpWebRequest request = null;
HttpWebResponse response = null;
string responseString = null;
NameValueCollection tags = null;
string url = null;
url = PROTECTED_URL;
Debug.WriteLine("Step 1: Requesting page @" + url);
request = (HttpWebRequest)WebRequest.Create(url);
request.AllowAutoRedirect = false;
response = (HttpWebResponse)request.GetResponse();
ShowResponse(response);
// Step 2: Get the redirection location
// make sure we have a valid response
if (response.StatusCode != HttpStatusCode.Found)
{
throw new ApplicationException();
}
url = response.Headers["Location"];
// Step 3: Open a connection to the redirect and load the login form,
// from this screen we will capture the required form fields.
Debug.WriteLine("Step 3: Requesting page @" + url);
request = (HttpWebRequest)WebRequest.Create(url);
request.AllowAutoRedirect = false;
try
{
response = (HttpWebResponse)request.GetResponse();
}
catch (Exception ex)
{
string str = ex.Message.ToString();
}
브라우저에서 예제 메서드를 호출 할 때 제대로 작동하지만 프로그래밍 방식으로 동일한 메서드를 호출 할 때? 먼저 코드를 보여주십시오. –
내 자격 증명으로 URL을 눌렀을 때 제대로 작동하지만 프로그래밍 방식으로 응답을받을 때 - 오류가 발생했습니다. –
코드를 표시하십시오. 어떻게 그것을 시도해보십시오 –