The athentication modes using Kerberos do not support the impersonation level 'Delegation'. Specify ...

本文介绍了解决WCF中使用KerberosRequestorSecurityToken时遇到的错误,该错误源于不支持的TokenImpersonationLevel.Delegation级别。通过采用WSE中的KerberosClientContext类替代,成功实现了所需的委托级别。

今天在使用WCF中的KerberosRequestorSecurityToken时候报了如题目所说的这个错误,反编译看来一下原来这个类仅仅支持

TokenImpersonationLevel.Identification 和TokenImpersonationLevel.Impersonation,

我的使用方法如下:

KerberosRequestorSecurityToken kqToken = new KerberosRequestorSecurityToken(targetPrincipal,
                                    System.Security.Principal.TokenImpersonationLevel.Delegation,
                                    null, "");
byte[] token = kqToken.GetRequest();

 

后来经过一番调查,发现在WSE中有相关的类可以使用,便将代码改成下边的样子,引用”Microsoft.Web.Services3.dll”,工作正常。

KerberosClientContext context = new KerberosClientContext(targetPrincipal, true, ImpersonationLevel.Delegation);
byte[] token = context.InitializeContext();

转载于:https://www.cnblogs.com/xioxu/archive/2009/12/01/1614706.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值