HTTP 기본 인증을 통해 자격 증명을 전달하는 것입니다. 사용자 이름 : 암호 구문이 HttpListener에서 지원되는지 확실하지 않지만, 그렇다면 기본 설정을 수락하도록 지정해야합니다. 먼저 인증하십시오. HTTP Listener에 함께 사용할 수있는 모든 지원 authenitcation 방법
HttpListenerBasicIdentity identity = (HttpListenerBasicIdentity)context.User.Identity;
Console.WriteLine(identity.Name);
Console.WriteLine(identity.Password);
Here's a full explanation : 당신이 요청을 받으면
HttpListener listener = new HttpListener();
listener.Prefixes.Add(uriPrefix);
listener.AuthenticationSchemes = AuthenticationSchemes.Basic;
listener.Start();
, 당신은 다음에 사용자 이름과 암호를 추출 할 수 있습니다.
죄송합니다 "나는 이름 경우 아니에요 : 암호 구문은 HttpListener에서 지원됩니다. "물론 클라이언트를"WWW-Authenticate : basic "헤더로 변환하는 클라이언트이기 때문에 클라이언트가 지원하는 경우에만 중요합니다. IE에 대한 지원이 최근에 중단 된 것 같습니다. –