Custom domain with ADB2C not working for next js auth provider based application

Anupam Baksi 0 Reputation points
2025-02-27T21:03:49.5866667+00:00

We have setup the custom domain for ADB2C using Azure front door as per the guideline from https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-domain.

We have tested the domain with existing sign in flow and that works. We are using custom policies with identity api where the front end is react and next js (auth providers) driven.

We tried changing the application level endpoints, policy burls but still not able to get the domain working. Can someone suggest or share inputs what else we can check for such type of application ?

I checked from below but no luck.https://learn.microsoft.com/en-us/answers/questions/2123614/how-can-i-get-custom-domains-to-work-with-azure-ac?source=docs

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,481 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Kancharla Saiteja 1,025 Reputation points Microsoft External Staff
    2025-03-03T11:57:31.68+00:00

    Hi Anupam Baksi,

    Thank you for posting your query on Microsoft Q&A.

    Based on your query, I understand you have an issue with changing the application URLs and endpoints and customize with your custom domain name.

    The information you provided confirmed that your custom domain has been configured and working with your policies. However, you would like to customize the endpoint URLs as well. Here are the three endpoints on which Azure AD B2C works:

    • https://<custom-domain>/<tenant-name>/<policy-name>/v2.0/.well-known/openid-configuration
    • https://<custom-domain>/<tenant-name>/<policy-name>/oauth2/v2.0/authorize
    • https://<custom-domain>/<tenant-name>/<policy-name>/oauth2/v2.0/token

    These URLs you can need to add the name of your domain in place of custom domain and provide tenant name and policy names accordingly.

    If you are working with social identity providers as well, please go through the steps in this doc. By this document, you will understand to add redirect URI with your custom domain to the application. This will make sure to have custom domain while sign in with social IDP's as well. Here is the sample:

    • https://<custom-domain-name>/<tenant-name>/oauth2/authresp

    Additional information:

    Here are the frequently asked questions of custom domain: https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-domain?pivots=b2c-custom-policy#frequently-asked-questions

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

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


Your answer

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