question

CarolLai-5934 avatar image
0 Votes"
CarolLai-5934 asked ChrisRegula-4610 commented

Azure AD B2C: Tutorial for Customize UI causes a script error

@amanpreetsingh-msft
When I tested the user flow,
https://docs.microsoft.com/en-us/azure/active-directory-b2c/tutorial-customize-ui#test-the-user-flow

I get the following error message from https://jwt.ms and signin page didn't even show up.

https://jwt.ms/?error=server_error&error_description=AADB2C90047%3a+The+resource+%27https%3a%2f%2fb2ctemp.blob.core.windows.net%2fb2c%2fcustom-ui.html%27+contains+script+errors+preventing+it+from+being+loaded.%0d%0aCorrelation+ID%3a+5e48c1bc-d1a1-4026-ad5f-78c262134ec2%0d%0aTimestamp%3a+2021-01-13+16%3a27%3a23Z%0d%0a

azure-ad-b2c
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, can you please post a screenshot of the error? It's not showing up here.

Thanks,
James

0 Votes 0 ·

The error is in the URL. Nothing was loaded because in the URL it says, it contains the script errors preventing it from being loaded.

0 Votes 0 ·

@CarolLai-5934 · Could you please try using this URL: https://moviesdiag132.blob.core.windows.net/b2c/unified2.html as Custom page URI under Page layouts section of your User Flow and let me know if it works or you still get the same error.

0 Votes 0 ·
Show more comments

1 Answer

amanpreetsingh-msft avatar image
1 Vote"
amanpreetsingh-msft answered ChrisRegula-4610 commented

Hi @CarolLai-5934 · Thank you for the confirmation.

To resolve the issue, you need to navigate to your Storage Account (where the HTML and CSS files are hosted) and configure CORS settings as highlighted below:

59244-image.png


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


image.png (65.3 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I had that setting in my CORS as ExxxCxxB2C.b2clogin.com because that's how it was shown in the user flow.
59248-userflowbug4.png

It turns out that the whole domain name has to be in lowercase letters. It's working now after I change the domain to all lowercase letters.

1 Vote 1 ·
userflowbug4.png (23.5 KiB)

It's working now after I change the domain to all lowercase letters. Thanks @CarolLai-5934

1 Vote 1 ·

Also, make sure that there is no trailing slash on the domain. For example, this should work:

 https://testmyapp.b2clogin.com

But this won't:

 https://testmyapp.b2clogin.com/


0 Votes 0 ·

This should be added to the documentation! Thanks spent a good while chasing this one down today

0 Votes 0 ·