【发布时间】:2016-08-31 19:44:07
【问题描述】:
请多多包涵:我对这一切都很陌生
我正在努力将 openid connect 与该公司开发的一对应用程序集成。
我们正在使用自定义/公司特定的 openid 连接库,我认为这些库本质上是围绕 Microsoft.Owin.Security.OpenIdConnect 和 Owin.Security.OpenIdConnect.Server 的包装器
在 idP 应用程序 web.config 中,我们有类似的内容:
<location path="." inheritInChildApplications="false">
<authentication mode="Forms">
<forms loginUrl="~/Login" name="{....}" protection="All" path="/" slidingExpiration="true" requireSSL="false" defaultUrl="~/Home" cookieless="UseCookies" />
</authentication>
<authorization>
<deny users="?" />
<!-- denies anonymous users to all pages, except those defined under location nodes -->
</authorization>
</location>
加上一堆位置节点来允许/拒绝对特定页面/资源的访问
问题是,当用户未登录(或者,它似乎正在登录过程中)时,当 openid connect 东西尝试访问 /.well-known/openid-configuration 时, 响应是 302 重定向到登录页面
显然这会在预期 JSON 响应时导致问题
我已尝试将位置节点添加到 web.config:
<location path= "~/.well-known/openid-configuration">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
(我也尝试过使用 path = "~/.well-known")
但我仍然被重定向到登录页面
需要明确的是,idP 应用程序中没有实际的目录 /.well-known;该文件似乎是在 Owin.Security.OpenIdConnect.Server 的某处构建的。
【问题讨论】:
标签: asp.net web-config openid-connect aspnet-contrib