简体   繁体   English

SAML和.NET 4.5

[英]SAML and .NET 4.5

I have an IDP that I need to integrate my application with. 我有一个IDP,我需要将其集成到我的应用程序中。 In the past I was able to easily setup an IDP using the Identity and Access tool extension in VS 2012. I have setup ACS and other IDPs that use Windows Federation. 过去,我能够使用VS 2012中的“身份和访问”工具扩展轻松设置IDP。我已经设置了ACS和其他使用Windows Federation的IDP。 But now I have a new IDP but they do not provide me with a federated metadata xml file which the tool needs. 但是,现在我有了一个新的IDP,但是它们没有为我提供该工具所需的联合元数据xml文件。 I am trying to figure out how to set this up. 我试图弄清楚如何设置它。 There is also one added level of complexity. 还增加了一层复杂性。 I need to create an "AuthRequest". 我需要创建一个“ AuthRequest”。 Does WIF (Windows Identity Foundation) support any of this or will I have to do this manually? WIF(Windows Identity Foundation)是否支持任何一种?还是我必须手动进行? Here is my approach please tell me if I can use any other methods: 这是我的方法,请告诉我是否可以使用其他方法:

  • Generate an AuthRequest: Specify the service url (post back url) in the Auth Request, sign the xml document (provide the IDP with the public key), base 64 encode it and perform a post to the URL the idp sent me (via SAMLRequest key value). 生成AuthRequest:在Auth Request中指定服务url(回发URL),对xml文档签名(使用公共密钥提供IDP),对它进行base 64编码,然后对idp发送给我的URL(通过SAMLRequest)进行发布核心价值)。

  • Once the user logs at the IDP the saml response will be sent to the URL I specified in the AuthRequest, I will then take the saml response (post via "SAMLResponse" key/value), base64 decode it, verify the digital signature (they provided me with their public key) and walk the XML data via XPATH to retrieve the NameID node value. 一旦用户登录IDP,saml响应将发送到我在AuthRequest中指定的URL,然后我将获取saml响应(通过“ SAMLResponse”键/值发布),对它进行base64解码,验证数字签名(它们向我提供了他们的公钥),然后通过XPATH遍历XML数据以检索NameID节点值。 For this part I am thinking about setting up a custom Http Handler. 对于这一部分,我正在考虑设置自定义Http处理程序。

  • Once I get the value, check my database to authenticate the user, using forms authentication create a ticket. 一旦获得值,请使用表单身份验证创建票证,检查数据库以对用户进行身份验证。 Now the user is authenticated. 现在,用户已通过身份验证。

Can you suggest a better way to do this? 您能建议一种更好的方法吗?

Thank you! 谢谢!

No - WIF does not support SAML. 否-WIF不支持SAML。

You have two choices: 您有两种选择:

Add a client side SAML stack to your application - some examples here . 将客户端SAML堆栈添加到您的应用程序- 这里有一些示例。

Or use ADFS as a bridge as it does support SAML. 或者使用ADFS作为桥梁,因为它确实支持SAML。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM