添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
天涯  ·  解决 No module named ...·  2 年前    · 
lichail  ·  android - Session ...·  4 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

How to set redirect URLs to b2clogin.com for Azure Active Directory B2C in React JS application

Ask Question

I am developing react js application and will be using azure adb2c for security ( reference ). To enable javascript in userflows, it seems I have to change redirect url to b2clogin.com . I have referred this https://learn.microsoft.com/en-us/azure/active-directory-b2c/b2clogin , but not clear on this point:

Set your Azure AD B2C application to use b2clogin.com for user flow references and token endpoints.

Can someone explain more on this? I have asked for any video reference in that page as well, waiting for their reply. I am not getting where to Change redirect URLs and where to Update in my application.

Question: I am not getting where to Change redirect URLs and where to Update in my B2C application?

Step: 1: Search B2C

According to your case you have to your B2C tenant first. To do that, go to azure portal. Click on All services , in search everything box type B2C then click on B2C Icon as shown below picture. See the screen shot below:

Step: 2: Go To B2C Application

Once you click on B2C icon you will be shown application on left tab menu, click on that and select your application you want to configure. See the screen shot below:

Step: 3: Select your Application

Select your application from application list for configuration. See the image below:

Step: 4: Configure Reply URL

Soon you select the application you want to configure you will see the Reply URL below the page as specified on following screen shot.

Add or configure your Reply URL as you want. You can add many Reply URL as per your need.

Question: Set your Azure AD B2C application to use b2clogin.com for user flow?

To configure b2clogin.com domain on your user flow please follow the steps below:

Step: 1: User flows (policies)

Go to your B2C application domain you will see User flows (policies) menu under policies section. See the below screen shot:

Step: 2: New User Flow / Existing From List

If you have existing user flow you can pick from the list or you can create new user flow by selecting `New User Flow' on top. See the Picture below:

Step: 3: Type A Flow Name

Type a name for your flow as I have specified in screen shot. Have look on below:

Step: 4: Page layouts For b2clogin.com User Flow

Once the new flow created in your case B2C_1_Test_Flow . Click on that from the flow list. You will see Page layouts menu on left menu bar. Click on Page layouts . If you want to set custom page url then click Yes to Use custom page content then Custom page URI would be enable for customization. See the Image below .

This is how you could customize your B2C Reply URL and Custom Page URL . If you have any more concern feel free to share here in comment. Happy coding!

1) The system not allowing multiple domain url's to add for Reply URL to my application as i have added my app service application url as the reply url in b2capplication. 2) Custom Page URI - I have given as xxazurestorage.blob.core.windows.net/xxxblob/… , how can I add my custom html file to be under b2clogin.com as in your screenshot? Vigneshwaran KS May 1, 2019 at 10:47 @VigneshwaranKS 1.Yes right you are, it does not allow to add multiple external url. 2. Though my UI is for Microsoft internal use, but you could customize your UI also please refer to this document here learn.microsoft.com/en-us/azure/active-directory-b2c/… Md Farid Uddin Kiron May 1, 2019 at 13:37 I don't want to use templates listed in user flows, if i customize my html for login and deploy to blob storage my javascript doesn't work as am not able to configure b2clogin.com in my app url. Any more ideas? I want to configure b2clogin.com as my domain. Vigneshwaran KS May 2, 2019 at 7:40 @MdFaridUddinKiron when I click on run user flow - it redirects from <mytenantname>.b2clogin.com to login.microsoftonline.com. Could you please let me know if this behavior is expected? NewbieHere Aug 29, 2022 at 8:02

Thanks all, I have resolved my problem. Used the latest library of b2c from https://github.com/leszekczajka/msal-b2c-react and in the initalize method i gave my tenant guid id instead of tenant name and added ValidateAuthority as false like below:

authentication.initialize({
    instance: 'https://mytenant.b2clogin.com/', 
    tenant: 'xxxxxxxxx_tenantGUID__xxxxxxxxxxxx',
    signInPolicy: 'B2C_1_signupsigninv2',
    resetPolicy: 'B2C_1_pwdresetv2',  
    applicationId: 'xxxxxxxxxxxxxx',
    cacheLocation: 'sessionStorage',
    scopes: ['https://mytenant.onmicrosoft.com/newsite/user_impersonation'],    
    validateAuthority: false,
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.