【问题标题】:Per action authentication handlers in ASP.NET CoreASP.NET Core 中的按操作身份验证处理程序
【发布时间】:2021-12-18 08:28:30
【问题描述】:

是否可以在 ASP.NET Core 中拥有每个操作的身份验证处理程序?如果有怎么办?

我想为一些路由设置一些特定的身份验证机制。其他的应该由整个身份验证处理程序覆盖。

【问题讨论】:

  • 我认为您可以使用过滤器来做到这一点。

标签: asp.net asp.net-core asp.net-web-api asp.net-authentication


【解决方案1】:

是的,这是可能的!您可以添加自定义身份验证方案并实现自定义逻辑来处理将使用新自定义身份验证方案的请求。看看这个https://referbruv.com/blog/posts/implementing-custom-authentication-scheme-and-handler-in-aspnet-core-3x

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-30
    相关资源
    最近更新 更多