10

我已将 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 = "/"
           });
       }

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

4

1 回答 1

4

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

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

请参阅此处的文档:启动身份验证流程

于 2017-09-18T19:04:55.997 回答