首页 > 解决方案 > [Authorize] 属性在 .Net Core 中从哪里获取登录 URL?

问题描述

当我对我的任何操作使用 Authorize 属性时,它会将我重定向到我的登录视图。我不记得在任何地方保存了登录 url,我在 .Net 4.x 中读到过,登录 url 保存在 .config 中。我们在 .Net 核心中没有任何 web.config,我也没有在 appSettings.json 中设置它。

Authorize 属性从哪里获取登录 URL?它与 UseAuthentication() 中间件有什么关系吗?我正在使用使用 Identity 的内置身份验证功能。

谢谢你。

标签: c#.netasp.net-core-mvcclaims-based-identityauthorize-attribute

解决方案


推荐阅读