IdentityServer4 QuickStart 注册问题
IdentityServer4 QuickStart Register Issue
我有 ASP.NET 核心应用程序和 IdentityServer4 使用 ASP.NET 核心身份(基于优秀的快速入门)。
http://docs.identityserver.io/en/release/quickstarts/6_aspnet_identity.html
在演练博客中,他们谈到导航到 localhost:5000/Account/Register 以在身份数据库中创建一个新用户。
当我导航到那个 url 时,我得到一个白页。此外,我没有 Register.cshmtl 页面或注册路由或任何包含术语注册的内容。
我是不是走错支线了?因为我正在发布并使用核心 2.0
我是新手,如果我遗漏了一些明显的东西,我深表歉意。
我有 运行 dotnet ef 命令,但在任何地方都看不到数据库 - 比如 sql express 或 LocalDb。
我在端口 5000
上从 vs17 中 运行 宁身份服务器项目
如果我 运行 MvcClient 项目,我会看到带有 Secure link 的主页。如果我单击我被定向到 IS4 实例,但 alice 或 bob 登录将起作用。 (无效 us/pw)。
我可以在日志中看到 alice 和 bob 用户没有在内存中创建
你现在可能已经知道了,但其他人可能会对它感兴趣。
Quickstart UI repository 不是 IdentityServer4 文档中教程的直接实现。如果您遵循文档,您将首先创建一个新的 ASP.NET Core MVC 应用程序,使用 Individual User Accounts 身份验证,该模板将创建注册页面。
我认为您的问题与路由有关。使用 scaffolding Identity 并指定路由 您的问题将得到解决。
To maintain full control of the Identity UI, run the Identity
scaffolder and select Override all files.
替换
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
和
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
.AddRazorPagesOptions(options =>
{
options.AllowAreas = true;
options.Conventions.AuthorizeAreaFolder("Identity", "/Account/Manage");
options.Conventions.AuthorizeAreaPage("Identity", "/Account/Logout");
});
services.ConfigureApplicationCookie(options =>
{
options.LoginPath = $"/Identity/Account/Login";
options.LogoutPath = $"/Identity/Account/Logout";
options.AccessDeniedPath = $"/Identity/Account/AccessDenied";
});
// using Microsoft.AspNetCore.Identity.UI.Services;
services.AddSingleton<IEmailSender, EmailSender>();
现在您可以访问注册帐户页面:
http://localhost:5000/Identity/Account/Register
您也可以根据需要更改默认路由 (localhost:5000/Account/Register) 为此检查此
我有 ASP.NET 核心应用程序和 IdentityServer4 使用 ASP.NET 核心身份(基于优秀的快速入门)。 http://docs.identityserver.io/en/release/quickstarts/6_aspnet_identity.html 在演练博客中,他们谈到导航到 localhost:5000/Account/Register 以在身份数据库中创建一个新用户。 当我导航到那个 url 时,我得到一个白页。此外,我没有 Register.cshmtl 页面或注册路由或任何包含术语注册的内容。
我是不是走错支线了?因为我正在发布并使用核心 2.0
我是新手,如果我遗漏了一些明显的东西,我深表歉意。 我有 运行 dotnet ef 命令,但在任何地方都看不到数据库 - 比如 sql express 或 LocalDb。 我在端口 5000
上从 vs17 中 运行 宁身份服务器项目如果我 运行 MvcClient 项目,我会看到带有 Secure link 的主页。如果我单击我被定向到 IS4 实例,但 alice 或 bob 登录将起作用。 (无效 us/pw)。 我可以在日志中看到 alice 和 bob 用户没有在内存中创建
你现在可能已经知道了,但其他人可能会对它感兴趣。
Quickstart UI repository 不是 IdentityServer4 文档中教程的直接实现。如果您遵循文档,您将首先创建一个新的 ASP.NET Core MVC 应用程序,使用 Individual User Accounts 身份验证,该模板将创建注册页面。
我认为您的问题与路由有关。使用 scaffolding Identity 并指定路由 您的问题将得到解决。
To maintain full control of the Identity UI, run the Identity scaffolder and select Override all files.
替换
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
和
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
.AddRazorPagesOptions(options =>
{
options.AllowAreas = true;
options.Conventions.AuthorizeAreaFolder("Identity", "/Account/Manage");
options.Conventions.AuthorizeAreaPage("Identity", "/Account/Logout");
});
services.ConfigureApplicationCookie(options =>
{
options.LoginPath = $"/Identity/Account/Login";
options.LogoutPath = $"/Identity/Account/Logout";
options.AccessDeniedPath = $"/Identity/Account/AccessDenied";
});
// using Microsoft.AspNetCore.Identity.UI.Services;
services.AddSingleton<IEmailSender, EmailSender>();
现在您可以访问注册帐户页面: http://localhost:5000/Identity/Account/Register
您也可以根据需要更改默认路由 (localhost:5000/Account/Register) 为此检查此