0

我将 microsoft-identity-web ( https://github.com/AzureAD/microsoft-identity-web ) 与 IdentityServer4 结合使用,以便使用 AAD 帐户通过 Identity server4 登录我的应用程序。一切正常。

我想知道是否可以向 microsoft-identity-web 提供 login_hint,以便可以预先填充 Microsoft 登录表单的名称字段。

4

1 回答 1

0

事实证明,您可以通过向身份验证属性提供登录提示来将用户名传递给外部身份验证流程,如下所示:

// start challenge and roundtrip the return URL and scheme 
var props = new AuthenticationProperties
{
   RedirectUri = redirectUrl,
   Items = {{"provider", provider.AuthenticationScheme}},
   Parameters = {{ "login_hint", <user name to display in login screen>}}
};
return Challenge(props, provider.AuthenticationScheme);

请参阅http://docs.identityserver.io/en/latest/topics/signin_external_providers.html了解有关如何使用 Microsoft 等外部身份提供商进行签名的信息。

于 2021-08-28T09:59:49.397 回答