我正在尝试为ADFS Proxy 2.0设置活动联盟。被动联合工作正常(因此我希望我已经正确配置了ADFS代理),但是当我使用活动联合时,我得到以下异常:" HTTP请求被禁止使用客户端身份验证方案' Anonymous&# 39;"
我使用以下代码:
var factory = new WSTrustChannelFactory(new UserNameWSTrustBinding(
SecurityMode.TransportWithMessageCredential,
HttpClientCredentialType.Digest),
"https://adfs-proxy/adfs/services/trust/13/usernamemixed");
factory.Credentials.UserName.UserName = username;
factory.Credentials.UserName.Password = password;
factory.Credentials.HttpDigest.AllowedImpersonationLevel =
TokenImpersonationLevel.Impersonation;
factory.TrustVersion = TrustVersion.WSTrust13;
var rst = new RequestSecurityToken {
RequestType = RequestTypes.Issue,
AppliesTo = new EndpointAddress(relyingPartyIdentifier),
KeyType = KeyTypes.Bearer
};
var channel = factory.CreateChannel();
return channel.Issue(rst);
Fiddler显示以下响应(我在没有Fiddler的情况下也得到了相同的错误):
HTTP/1.1 403 Forbidden
Transfer-Encoding: chunked
Server: Microsoft-HTTPAPI/2.0
Date: Mon, 01 Jun 2015 13:06:16 GMT
0
ADFS跟踪日志中有以下消息:
WSTrustProxyListener.ProcessRequest:拒绝前端请求 资源 https://adfs-proxy:443/adfs/services/trust/13/usernamemixed/
如果我将url更改为指向原始ADFS服务器而不是代理,则上面的代码可以正常工作(向ADFS发送相同的请求)。
代理的ADFS服务器中允许使用/ adfs / services / trust / 13 / usernamemixed端点。
我还发现当我访问指向ADFS代理服务器的以下链接时:
https://adfs-proxy/federationmetadata/2007-06/federationmetadata.xml
我也得到403 Forbidden回复。我在ADFS跟踪日志中看到相同的消息:
WSTrustProxyListener.ProcessRequest:拒绝前端请求 资源 https://adfs-proxy:443/FEDERATIONMETADATA/2007-06/FEDERATIONMETADATA.XML
Wireshark向我显示ADFS代理到主ADFS服务器没有网络请求。
如果我为此链接指定原始ADFS服务器(不是代理),一切正常,返回正确的xml。实际上,对于ADFS代理,无论是否允许ADFS代理,我都会向以下侦听器(如果我在IE中命中)获取403 Forbidden:
https://+:443/FederationMetadata/2007-06/
http://+:80/adfs/services/trust/
https://+:443/adfs/services/trust/
我尝试在各种帐户下运行ADFS代理服务,包括网络服务和本地管理员。
如何摆脱此错误并为ADFS代理设置Active Federation?
答案 0 :(得分:0)
为了它的价值,自昨晚以来我一直在处理这个问题。
特别是,此错误:WSTrustProxyListener.ProcessRequest: Rejected front-end request to resource https://adfs-proxy:443/FEDERATIONMETADATA/2007-06/FEDERATIONMETADATA.XML.
尝试从联合代理服务器提取federationmetadata.xml时,我会收到403。
我还收到了以下错误消息:
The federation server proxy was not able to retrieve the list of endpoints from the Federation Service at [adfs_server_name]. The error message is 'Error reading the C:\Program Files\Active Directory Federation Services 2.0\PT directory.'.
我修改了此c:\ program files \ active directory \ federation services 2.0 \ PT文件夹的安全设置,并为具有" LogonAs"的用户提供了完全访问权限。 " ADFS 2.0 Windows服务"的权限联合代理服务。
此时,我能够通过https://sso.proxy.fdqn.com/federationmetadata/2007-06/federationmetadata.xml
成功提取联盟元数据