【发布时间】:2013-10-01 12:04:00
【问题描述】:
我正在尝试从 ADFS 获取一个令牌,以便我可以将它与本地 Windows 服务总线安装一起使用。我可能没有正确配置 ADFS,因为我收到以下消息:
MSIS3127:指定的请求失败。
获取token的代码如下:
string adrecaSTS = "trust/13/usernamemixed";
WS2007HttpBinding binding = new WS2007HttpBinding();
binding.Security.Message.EstablishSecurityContext = false;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
binding.Security.Mode = SecurityMode.TransportWithMessageCredential; //https
string baseSSLUri = @"https://<myadfs>/adfs/services/";
WSTrustChannelFactory trustChannelFactory = new WSTrustChannelFactory(binding, new EndpointAddress(baseSSLUri + adrecaSTS));
trustChannelFactory.TrustVersion = TrustVersion.WSTrust13;
trustChannelFactory.Credentials.UserName.UserName = "username";
trustChannelFactory.Credentials.UserName.Password = "password";
WSTrustChannel tokenClient = (WSTrustChannel)trustChannelFactory.CreateChannel();
//create a token issuance issuance
RequestSecurityToken rst = new RequestSecurityToken(RequestTypes.Issue);
//call ADFS STS
SecurityToken token = tokenClient.Issue(rst);
端点在 ADFS 上启用,我的客户端(单独域上的笔记本电脑)信任来自 ADFS 的证书。
我是否需要建立某种信任或进一步的东西?此错误消息不是特别有用。
【问题讨论】:
标签: wcf-security wif claims-based-identity adfs2.0 adfs