相关疑难解决方法(0)

WCF和Kerberos身份验证

我已经关注了许多msdn文章和codeplex指南,但无法让WCF使用Kerberos身份验证和委派,并希望得到一些帮助.

建立

我在远程计算机上的IIS网站上有WCF服务

  • Windows 2003 R2上的IIS 6.0 - SP 2
  • 已添加机器的SPN(http/myserver && http/myserver:8080)
  • 已为IIS应用程序池创建AD帐户
  • AD帐户具有设置,允许委派(对于Kerberos),设置为true

我在8080上使用Brian Booth的调试站点,该站点传递了Kerberos委派的所有要求.调试IIS站点已关闭匿名身份验证,并启用了集成Windows身份验证.

我已将这些设置镜像到托管WCF服务的站点.

Web服务 - Web配置(原始)

<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="WsHttpBindingConfig">
                <security>
                    <message negotiateServiceCredential="true" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings> 
    <services>
        <service behaviorConfiguration="ServiceBehavior" name="Service">    
            <endpoint address="" 
                binding="wsHttpBinding" 
                bindingConfiguration="WsHttpBindingConfig" 
                contract="IService">    
                <identity>    
                    <servicePrincipalName value="http/myserver" />    
                    <dns value="" />    
                </identity>    
            </endpoint>    
            <endpoint address="mex" 
                binding="mexHttpBinding" 
                contract="IMetadataExchange" />    
        </service>    
    </services>    
    <behaviors>    
        <serviceBehaviors>    
            <behavior name="ServiceBehavior">    
                <serviceMetadata httpGetEnabled="true"/>    
                <serviceDebug includeExceptionDetailInFaults="true"/>    
                <serviceAuthorization 
                    impersonateCallerForAllOperations="true" />    
            </behavior>    
        </serviceBehaviors>    
    </behaviors>    
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

Web服务 - Web方法

[OperationBehavior(Impersonation …
Run Code Online (Sandbox Code Playgroud)

wcf kerberos wcf-security

9
推荐指数
2
解决办法
3万
查看次数

了解WCF Windows身份验证

我有一个Windows身份验证服务.使用以下代码,我可以获得(通过使用客户端)消费该服务的用户的Windows标识.

String currentUser = OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name;
Run Code Online (Sandbox Code Playgroud)

服务器中的配置是:

<binding name="messageSecurity">
<security mode="Message">
<message clientCredentialType="Windows"/>
</security>
</binding>
Run Code Online (Sandbox Code Playgroud)

我还读到,在服务器中,它使用Kerberos来实现这一点.

现在,我试图了解它在我们企业网络中的重要性.在办公室中,用户将使用其活动目录凭据登录其桌面.我们的服务托管在名为"SERV1"的Windows服务器中.

  1. 只有访问(登录)"SERV1"的用户才能访问该服务吗?或者所有能够登录办公室网络的用户(起诉活动目录凭证)都可以使用该服务?

  2. 有没有办法确保只有CIO批准的应用程序才能访问该服务,将服务保持为Windows身份验证?

  3. 是否针对每个服务操作呼叫或仅针对第一个呼叫进行此身份验证检查?

  4. 有什么方法服务将能够知道用户的Windows凭据?

注意:据我所知,WindowsAuthentication可以与会员提供商进行比较 - 从集中位置提供用户名和密码.它可以与ASP.Net成员资格提供程序或Active Directory成员资格提供程序进行比较.

进一步阅读:

  1. ASP.NET Active Directory成员资格提供程序和SQL Profile Provider

  2. wcf数据合同授权

  3. http://www.theserverside.net/tt/articles/showarticle.tss?id=ClaimsBasedSecurityModel

.net c# asp.net wcf windows-authentication

7
推荐指数
1
解决办法
1万
查看次数