나는 WCF 서비스를 사용하여 데이터베이스에서 읽기와 같은 작업을 수행하고 통합 보안을 사용할 수있는 거대한 응용 프로그램을 작성했습니다. 이 그것을 많이 만들 것 때문에,WCF 사용자 그룹 가져 오기
string userName = HttpContext.Current.User.Identity.Name;
그러나 나는 사용자가에있는 활성 디렉토리 그룹을 얻을 수 있도록하려면 :
기압 나는 사용자 이름의 현재 로깅을 얻기 위해 다음 코드를 사용하여 새로운 사용자를 항상 추가하는 대신에 더 쉽습니다. 누구나 간단하고 깨끗한 방법으로이 작업을 수행 할 수 있습니다.
<service behaviorConfiguration="ZNA.Integratie.KopMon.Web.LoginServiceBehavior"
name="ZNA.Integratie.KopMon.Web.LoginService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="Security" contract="ZNA.Integratie.KopMon.Web.LoginService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<behavior name="ZNA.Integratie.KopMon.Web.LoginServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<binding name="Security">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
을 당신의 그룹을 필요합니까 왜이 관련이 있지만, 내 엔드 포인트는 다음과 같이 구성되어있는 경우
는 몰라 사용자가 회원입니까? 승인 목적을위한 것이라면, 더 나은 모델은 단순히 그 또는 그녀가 특정 그룹/역할의 구성원인지 여부를 묻는 것입니다. –