简体   繁体   English

是否可以自定义Azure AD登录报错信息?

[英]Is it possible to customise Azure AD login error messages?

We have a Drupal site setup to login with Azure AD via a third party OpenID connect module.我们有一个 Drupal 站点设置,可以通过第三方 OpenID 连接模块使用 Azure AD 登录。 This is linked to an Azure AD app registration in single tenant mode.这链接到单租户模式下的 Azure AD 应用程序注册。 When a user visits the site whilst logged-in to an account that isn't in our tenant, they see an error message similar to this:当用户登录到不在我们租户中的帐户访问该站点时,他们会看到类似于以下的错误消息:

Message:AADSTS50020: User account 'XXXXX@example.com' from identity provider 'https://sts.windows.net/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/' does not exist in tenant 'TENANT NAME' and cannot access the application 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'(SITE NAME) in that tenant.消息:AADSTS50020:来自身份提供者“https://sts.windows.net/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/”的用户帐户“XXXXX@example.com”在租户“租户名称”中不存在,无法访问该租户中的应用程序“XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX”(站点名称)。 The account needs to be added as an external user in the tenant first.需要先在租户中将账号添加为外部用户。 Sign out and sign in again with a different Azure Active Directory user account.注销并使用不同的 Azure Active Directory 用户帐户再次登录。

This message is completely incomprehensible to most of our users.我们的大多数用户完全无法理解此消息。 I'd like to change it to something more meaningful such as我想将其更改为更有意义的内容,例如

Please login with an INSTITUTION NAME account to access this site eg: username@ourdomain.com请使用 INSTITUTION NAME 帐户登录以访问此站点,例如:username@ourdomain.com

Is this something that can be configured within the Azure AD app registration?这是可以在 Azure AD 应用程序注册中配置的东西吗? Or elsewhere in our tenancy configuration?或者在我们的租赁配置中的其他地方?

In case of azure ad B2C you can create a custom error page using a technical profile based on localization or a custom policy error page.对于 azure 广告 B2C,您可以使用基于本地化技术配置文件或自定义政策错误页面创建自定义错误页面。 But in case of regular Azure AD (B2B) , there is no way to specify custom error messages or error pages.在常规 Azure AD (B2B) 的情况下,无法指定自定义错误消息或错误页面。

If there is any case where the error message is passed back to your application.如果在任何情况下都会将错误消息传回您的应用程序。 there may be a possibility to deal with it as you can configure through code as required but there isn't any guidance regarding error passed to backend.可能有可能处理它,因为您可以根据需要通过代码进行配置,但没有关于传递给后端的错误的任何指导。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM