我正在尝试通过活动联合对 ADFS 服务器进行身份验证,但在尝试对用户进行身份验证之前,需要通过 AD/LDAP 查询转换传入的用户名。
我正在使用带有 UserNameWSTrustBinding 的 UsernameMixed 端点:
WSTrustChannelFactory factory = new WSTrustChannelFactory(new UserNameWSTrustBinding(SecurityMode.TransportWithMessageCredential), "https://nobody.com/adfs/services/trust/13/UsernameMixed");
factory.TrustVersion = TrustVersion.WSTrust13;
factory.Credentials.UserName.UserName = userName;
factory.Credentials.UserName.Password = password;
IWSTrustChannelContract channel = factory.CreateChannel();
RequestSecurityToken rst = new RequestSecurityToken(RequestTypes.Issue, WSTrust13Constants.KeyTypes.Bearer);
SecurityToken token = channel.Issue(rst);
我的问题是,我想在运行身份验证之前将传递给端点的“用户名”转换为 ADFS 服务器上的用户电子邮件地址(通过 AD 或 LDAP)。这可能吗?