DEV Community

Discussion on: Customize the look and feel of your Azure AD B2C page

Collapse
 
topacv profile image
Vasile Topac

Hey.
Thanks for the informative article. I have a question.
How safe is it to rely on the IDs of the injected elements?
Isn't there the risk that Microsoft will change the ids, and then custom JS parsing will fail?

On a project I'm adding more logic that relies on the IDs of elements injected by AD B2C in the "api" div (example of injected elem id: "emailVerificationControl_but_verify_code"), and show/hide some buttons with JQuery, to make a more custom UI.
It all works, but I'm not sure how safe is to do this on the long run? (and can't really find this info in the official docs).

Thank you,
Vasile

Collapse
 
topacv profile image
Vasile Topac

Just to make things more clear, I don't only rely on IDs of injected inputs, but also on IDs of injected buttons.

Collapse
 
rcls profile image
OssiDev • Edited

I'd say if Microsoft goes and changes the ID's they break backwards compatibility. But the page layouts do have versioning, so if you lock it to a specific version I think you're safe.

Quote from the page layout version:

This is the version of the packaged content containing HTML, CSS and JavaScript provided by Azure AD B2C

So I'm guessing if you lock it to a specific version and not use the latest, you're safe. I don't think the layout automatically changes. Mine's locked in 2.1.5 and the latest is 2.1.6.

Thread Thread
 
christosmatskas profile image
Christos Matskas

That's right. If you pin it to a specific version, you should be OK. But you're right in thinking that things/IDs could potentially change. I would expect that this would be properly communicated ahead of time though, especially if there going to be breaking changes