小编Cra*_*aig的帖子

我的 AspNet Core 3.1 身份页面在 IdentityServer4 中给出了 404。我怎样才能访问这些?这是路径问题吗?

我遵循了这里的 Deblokt 教程该教程详细解释了如何在 .net core 3.1 中设置 IdentityServer4 并为用户存储使用 AspNetCore Identity。

我可以从https://localhost:5001/Account/Login url(和注销)登录到我的 IdentityServer就好了......但我无法访问 AspNet Core Identity 页面(例如 Register/ForgotPassword/AccessDenied 等)。我已经将它们放在脚手架上,所以它们位于 Areas/Identity/Pages/Account 下...但是当我导航到它们时,例如https://localhost:5001/Identity/Account/Register,我只是找不到 404。

我不确定,但怀疑这可能是路由问题,所以我研究了为这些页面提供路由,但我看到的 IdentityServer 示例适用于 Core2.1 并使用 app.UseMVC ...我的启动不具有。我试图包含它,但我收到错误消息

端点路由不支持“IApplicationBuilder.UseMvc(...)”。要使用 'IApplicationBuilder.UseMvc' 在 'ConfigureServices(...)' 中设置 'MvcOptions.EnableEndpointRouting = false'

那么我该往哪里去呢?

我从 GitHub 下载了随附解决方案的教程,但它是 Core 2.1 解决方案,因此怀疑该教程是重写/升级到 3.1 的版本。

这是我的启动文件...

public class Startup
{

        public IWebHostEnvironment Environment { get; }
        public IConfiguration Configuration { get; }
        public Startup(IWebHostEnvironment environment, IConfiguration configuration)
        {
            Environment …
Run Code Online (Sandbox Code Playgroud)

routes asp.net-identity identityserver4 razor-pages asp.net-core-3.1

9
推荐指数
1
解决办法
1729
查看次数