是否有示例如何将 OneLogin SSO (SAML) 集成到 ASP NET MVC 应用程序,例如使用 Kentor Auth Owin 扩展?
1 回答
详细步骤(假设您的应用托管在http://localhost/SampleApp):
从https://github.com/KentorIT/authservices下载最新版本的 KentorIT AuthServices并在 Visual Studio 中打开 Kentor.AuthServices.sln 解决方案。
识别 SampleApplication 项目并复制其 URL 属性,SampleApplication SP 的 ACS 和 SLS 端点基于该值
转到 Onelogin,应用程序 > 添加应用程序,然后在浏览器中搜索SAML 测试连接器并选择它。
在连接器的配置选项卡中,添加 Audience、Recipient、ACS 和 SLS 值,如果您的 SP 基本 URL 是http://localhost/SampleApp/,那么您应该添加:
- 收件人和 ACS URL:http://localhost/SampleApp/AuthServices/Acs
现在是配置 SP AuthServices 的时候了,编辑 SampleApplication 项目的 web.config 文件。在该部分中,输入以下值:
- entityId = http://localhost/SampleApp/AuthServices
- returnUrl = http://localhost/SampleApp
在 Onelogin 连接器的 SSO 选项卡上,您将找到颁发者、SSO URL、SLO URL,您需要在 web.config 文件中注册这些数据,以及在 identityProviders 元素上注册 entityID、signOnUrl、logoutUrl。同样在 Onelogin 的 SSO 选项卡中,您会找到 IdP x509 证书,您可以在 Kentor 的配置中将其注册为签名证书。在此处查看 Kentor 文档