Asp.net mvc 4 使用基于声明的身份验证在MVC应用程序中放置重定向代码的位置

Asp.net mvc 4 使用基于声明的身份验证在MVC应用程序中放置重定向代码的位置,asp.net-mvc-4,authentication,claims-based-identity,claims,Asp.net Mvc 4,Authentication,Claims Based Identity,Claims,我已设置ADFS以返回以下索赔: UseragreementAccepted:真/假 当我访问我的MVC应用程序时,我想检查这个声明,如果value==false,我想将用户重定向到一个完全不同的web应用程序,在那里用户可以阅读并接受useragreement 我应该把这个重定向代码放在我的MVC应用程序的哪里?我应该写一个定制的HttpHandler/模块、AuthenticationManager、AuthorizationManager还是其他东西 申请流程: https://mvcap

我已设置ADFS以返回以下索赔: UseragreementAccepted:真/假

当我访问我的MVC应用程序时,我想检查这个声明,如果value==false,我想将用户重定向到一个完全不同的web应用程序,在那里用户可以阅读并接受useragreement

我应该把这个重定向代码放在我的MVC应用程序的哪里?我应该写一个定制的HttpHandler/模块、AuthenticationManager、AuthorizationManager还是其他东西

申请流程:

https://mvcapp/
-> https://adfs/
-> https://mvcapp/ -> inspect claims -> 
-> if UseragreementAccepted==false, then redirect to https://accessapp/  
-> user can read useragreement and accept it

您是否考虑过global.asax中的应用程序启动?@Sid-Application\u Start仅在工作进程启动时运行一次。它不涉及用户执行的任何操作,我还想将我的逻辑打包到一个NuGet包中,以供其他MVC应用程序重用。将处理程序添加到configurationfile比手动将代码/逻辑添加到global.asax或类似文件更容易。我还没有使用AuthenticationMAnager和AuthorizationManager的任何经验,因此我不确定这是否是比HttpHandler/模块更好的替代方案,或者它是否可以工作