如何到达openiddict授权服务器的注册页面?

时间:2017-04-27 08:52:53

标签: asp.net-core .net-core openiddict

我已将opeiddict构建为单独的Web应用程序作为授权服务器。我遇到了一个小问题,就是我可以通过客户端Web应用程序的链接直接进入用户注册页面。现在我可以进入登录页面,作为示例:

public ActionResult SignIn() {
           // Instruct the OIDC client middleware to redirect the user agent to the identity provider.
           // Note: the authenticationType parameter must match the value configured in Startup.cs
           return new ChallengeResult(OpenIdConnectDefaults.AuthenticationScheme, new AuthenticationProperties {
               RedirectUri = "/"
           });
       }

有没有办法从客户端应用程序转到身份验证服务器帐户/注册?

1 个答案:

答案 0 :(得分:4)

看起来您可以在重定向中设置网址。请参阅以下代码段:

[AllowAnonymous]
public IActionResult SignIn()
{
    return new ChallengeResult(
        OpenIdConnectDefaults.AuthenticationScheme,
        new AuthenticationProperties
        {
            IsPersistent = true,
            RedirectUri = Url.Action("SignInCallback", "Account")
        });
}

请参阅此处的文档:Initiating the authentication flow