자기 자신을 구르거나 명시 적 매개 변수를 추가하지 마십시오. 실제로 너무 많은 작업입니다!
WCF 보안 기능을 확인하십시오. 사용 가능한 기능이 많이 있습니다! 예 : 메시지를 보호하고 메시지 안에 자격 증명을 포함 시키십시오. 즉석에서 별도로 코딩 할 필요가 없습니다!
체크 아웃이 우수한 미셸 레녹스 부스타하여 WCF 보안에 대한 기사 : 귀하의 경우 http://www.devx.com/codemag/Article/33342
, 나는 사용자 이름 자격 증명을 사용하여 메시지 보안을 건의 할 것입니다 - 당신은 양쪽 끝이를 구성해야합니다
서버 측 : 클라이언트 측에서 동일한 설정을 적용 할 필요가
<bindings>
<basicHttpBinding>
<binding name="SecuredBasicHttp" >
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="YourService">
<endpoint address="http://localhost:8000/MyService"
binding="basicHttpBinding"
bindingConfiguration="SecuredBasicHttp"
contract="IYourService" />
</service>
</services>
그리고 :
<bindings>
<basicHttpBinding>
<binding name="SecuredBasicHttp" >
<security mode="Message">
<message clientCredentialType="UserName"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:8000/MyService"
binding="basicHttpBinding"
bindingConfiguration="SecuredBasicHttp"
contract="IYourService" />
</client>
이제 서버와 클라이언트가 보안에 동의 - 클라이언트에서, 당신은 다음과 같이 사용하는 사용자 이름과 암호를 지정하는 것 :
서버 측에
YourServiceClient client = new YourServiceClient();
client.ClientCredentials.UserName.UserName = "your user name";
client.ClientCredentials.UserName.Password = "top$secret";
, 당신이 필요합니다 일반적으로 Windows 도메인 (Active Directory) 또는 ASP.NET 멤버 자격 공급자 모델에 대해 이러한 사용자 자격 증명의 유효성을 검사하는 방법을 설정합니다. 어떤 경우에도 정의한 상점에 대해 사용자 신임을 확인할 수 없으면 호출이 거부됩니다.
희망 사항은 WCF에서 비트 보안이 큰 주제이며 많은 옵션을 가지고 있습니다. 조금 어려울 수 있지만 결국에는 일반적으로 의미가 있습니다! :-)
마크
좋아 보인다. 원시 httpwebrequest를 사용하는 경우이 (또는 비슷한) 사용 가능 여부를 알 수 있습니까? 나는 같은 방식으로 보안 싶습니다 사용자 지정 RPC 스택이 있습니다 (나는 사소한 대답이 있다면 물론 새로운 queston로 요청할 수 있습니다) –
그래야합니다; http://www.silverlightshow.net/items/Cookies-in-Silverlight-Web-Requests.aspx – blowdart
Ta; 나는 그것을 볼 것이다 ;-p –