我正在结合使用microsoft- identity -web (https://github.com/AzureAD/microsoft-identity-web)和IdentityServer4,以便能够使用AAD帐户通过identity server4登录我的应用程序。一切都运行得很好。
我想知道是否有可能向microsoft-identity-web提供一个login_hint,以便可以预先填写微软的登录表单的名称字段。
发布于 2021-08-28 09:59:49
事实证明,您可以通过向身份验证属性提供登录提示,将用户名传递给外部身份验证流,如下所示:
// 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。
https://stackoverflow.com/questions/66213466
复制相似问题