How to Customize Azure AD Error Message for Unassigned Users?

Vishnu Prasad 20 Reputation points
2025-04-11T07:34:41.55+00:00

We are currently using Azure Active Directory for authentication in our Angular SPA.

Our setup uses the Authorization Code Flow with PKCE, integrated via the angular-auth-oidc-client npm package:

OpenID Connect, OAuth Code Flow with PKCE, Refresh tokens, Implicit Flow

We are seeing the Azure AD error message AADSTS50105 when users who are not assigned to the application try to sign in. The current message shown to users is

thumbnail_image017

While the message is expected since the user is not part of the application, we would like to customize this error page to include our own instructions or branding, such as how users can request access or whom to contact in our organization.

  • We are aware that Azure AD does not natively allow direct customization of the default error message.
  • We are not looking to modify our application code at this point.

We would like help with:

  1. Is there any supported way to customize this error message or redirect users to a custom error page, through Azure AD branding or any configuration in Azure Portal?
  2. Are there any workarounds to achieve this behavior without modifying the application itself?

Any guidance, documentation, or experiences from others who've handled this scenario would be greatly appreciated.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

Answer accepted by question author
  1. Jyotishree Moharana 1,860 Reputation points Microsoft External Staff Moderator
    2025-04-11T14:40:31.0166667+00:00

    Hello @Vishnu Prasad,

    That is correct, unfortunately at the moment Entra doesn't have any provision to provide customization on the error message. AADSTS50105 is one of the standard AADSTS error that occurs when authorization fails for the user. Being a standard error doing any customization of the content or re-directing user to other custom error page is not possible from Entra portal settings.

    Workaround could be to modify the application app code which can inspect the error returned and then redirect the user to the custom page.

    But as you have mentioned modification of application is currently not intended, we would advise to share your requirement as feature request on Microsoft Feedback portal, so our engineering team can consider implementing this feature in future.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.