首页 > 解决方案 > ASP.NET Core:带有 OpenID Connect 的注册按钮

问题描述

我有一个 asp.net 核心应用程序,我通过 keycloak 使用开放 id 连接身份验证。认证配置如下:

.AddOpenIdConnect(options =>
{
    // URL of the Keycloak server
    options.Authority = Configuration["Oidc:Authority"];
    // Client configured in the Keycloak
    options.ClientId = Configuration["Oidc:ClientId"];

    // For testing we disable https (should be true for production)
    options.RequireHttpsMetadata = Env.IsProduction();

    options.SaveTokens = true;

    // Client secret shared with Keycloak
    options.ClientSecret = Configuration["Oidc:ClientSecret"];
    // options.GetClaimsFromUserInfoEndpoint = true;

    // OpenID flow to use
    options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
});

正常登录/注销工作正常,我也可以通过在 keycloaks 登录表单中单击“注册”来注册新用户。

现在我想在我的应用程序中直接有一个“注册”按钮。此按钮不应指向登录表单,而是指向 keycloaks 注册表单。

我找到了这封邮件:https ://lists.jboss.org/pipermail/keycloak-user/2016-August/007473.html

但我无法弄清楚如何以这种方式配置参数,它可以工作。

标签: c#asp.net-corekeycloakopenid-connect

解决方案


推荐阅读