IdentityServer 处理超时和后续重定向

IdentityServer handling timeouts and subsequent redirects

我已经在我的应用程序中实施了 IdentityServer3,它运行得非常好。但是最近我遇到了一些我不太明白的行为,所以我希望有人能告诉我我做错了什么或者我应该如何做以下事情:

我有一个 ASP.NET MVC 应用程序,它使用 IdentityServer 进行身份验证。用户验证并打开应用程序中的特定页面。他离开他的 PC,稍后回来并在应用程序中单击另一个 link(例如 controller/action/38)。然后应用程序将用户重定向到:

http://localhost/MyIdentityServer/identity/connect/authorize?client_id=myapp&redirect_uri=http://localhost/MyApp/controller/action/38&response_mode=form_post&response_type=id_token&scope=openid+profile+roles etc.

因为只有应用程序 (http://localhost/MyApp) 的根目录 url 在 IdentityServer 中注册为 RedirectUrl,所以显示以下消息:

客户端应用程序未知或未经授权。

理所当然,因为控制器 + 操作不是有效的 RedirectUrls。但是,我无法想象我必须将所有控制器和操作添加到 RedirectUrl 属性,尤其是因为它们采用与数据相关的参数。我肯定做错了什么,但是什么?

您在对 idsrv 的每个请求修改提供给 idsrv 的 redirecturi:

删除这一行:

   notification.ProtocolMessage.RedirectUri = something