hac*_*sid 11 .net c# saml federated-identity wif
似乎大多数WIF信息对于在整个应用程序中启用联合身份验证很有用.我有兴趣使用API创建SAML身份验证请求并接收/解释SAML响应.
我在SOL 阅读SAML令牌的SAML属性上发现了以下帖子,这使我在接收和解释SAML响应方面朝着正确的方向前进.任何人都可以向我提供有关如何使用API创建SAML请求的更多信息吗?
一般来说,API上的更多信息(阅读材料,视频等)将不胜感激.
以下是我们的一个示例,其中显示了如何以编程方式为STS创建(SAML)安全令牌请求:
private static SecurityToken GetSamlToken(string realm, string stsEndpoint, ClientCredentials clientCredentials)
{
using (var factory = new WSTrustChannelFactory(
new UserNameWSTrustBinding(SecurityMode.TransportWithMessageCredential),
new EndpointAddress(new Uri(stsEndpoint))))
{
factory.Credentials.UserName.UserName = clientCredentials.UserName.UserName;
factory.Credentials.UserName.Password = clientCredentials.UserName.Password;
factory.Credentials.ServiceCertificate.Authentication.CertificateValidationMode = X509CertificateValidationMode.None;
factory.TrustVersion = TrustVersion.WSTrust13;
WSTrustChannel channel = null;
try
{
var rst = new RequestSecurityToken
{
RequestType = WSTrust13Constants.RequestTypes.Issue,
AppliesTo = new EndpointAddress(realm),
KeyType = KeyTypes.Bearer,
};
channel = (WSTrustChannel)factory.CreateChannel();
return channel.Issue(rst);
}
finally
{
if (channel != null)
{
channel.Abort();
}
factory.Abort();
}
}
Run Code Online (Sandbox Code Playgroud)
由于没有其他人回答,这里有一篇来自无与伦比的Michelle Bustamante的文章:
| 归档时间: |
|
| 查看次数: |
13461 次 |
| 最近记录: |