gpt4 book ai didi

azure - 在 Azure AD B2C 中设置 ui-locales 从应用程序内登录 (.NET Core)

转载 作者:行者123 更新时间:2023-12-02 20:39:14 26 4
gpt4 key购买 nike

我正在开发 ASP.NET Core 应用程序,该应用程序利用 Azure AD B2C 进行用户管理。我希望将登录/注册表单本地化为多种语言。我在 Azure 门户的 Azure AD B2C 管理仪表板中添加了新的策略语言。

现在,我想在从应用程序调用 Azure AD B2C 时设置 ui-locales 参数(如 this documentation page 中所述)。这是我无法实现的部分,因为我不确定在哪里可以注入(inject)这个参数并需要帮助。

最佳答案

Wingtip Games 示例位于 hereOnRedirectToIdentityProvider 事件中设置 ui_locales 查询字符串参数,如下所示:

// If an Account controller action has set a UI locale (e.g. to "fr"), then set the UI locales parameter for
// the authentication request to this UI locale.
if (context.Properties.Items.ContainsKey(Constants.AuthenticationPropertiesKeys.UILocales))
{
context.ProtocolMessage.UiLocales = context.Properties.Items[Constants.AuthenticationPropertiesKeys.UILocales];
context.Properties.Items.Remove(Constants.AuthenticationPropertiesKeys.UILocales);
}

关于azure - 在 Azure AD B2C 中设置 ui-locales 从应用程序内登录 (.NET Core),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46333513/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com