1

I understand that it is recommended to break down Custom policy definition xml files into multiple file as shown in the starter packs:

  • TrustFrameworkBase.xml
  • TrustFrameworkExtensions.xml
  • TrustFrameworkLocalization.xml
  • SignUpOrSignin.xml
  • ... other relying parties

however, some of the sample codes are provided as a "all in one" single file code like this one:

https://github.com/azure-ad-b2c/samples/blob/master/policies/dynamic-sign-up-sign-in/policy/SignUpOrSignIn_Dynamic.xml

I can use the single file policies as is - but I wonder should I make special effort to break them down into multiple files as shown in the starter packs?

Allan Xu
  • 7,998
  • 11
  • 51
  • 122

2 Answers2

2

If you just want to run them as samples, no.

But in general, you should not touch the Base and Extension files and do all your development in your own extension file.

This is so if the starter pack is updated, you can pretty much copy it over. Otherwise, you have to merge.

rbrayb
  • 46,440
  • 34
  • 114
  • 174
  • Thanks for help. But the code sample in my sample comes as a single file. It is not coming as starter pack. That is why I asked if I should spend time to re-factor it. It is not based on any starter pack. Just a simple file sample. – Allan Xu Apr 26 '23 at 03:55
1

The SignUpOrSignIn_Dynamic.xml policy you linked to is not an "all in one" solution. It is based on the Social and LocalAccounts with MFA starter pack.

The policy acting as base policy is mentioned at the beginning in lines 5 - 8:

<BasePolicy>
  <TenantId>yourtenant.onmicrosoft.com</TenantId>
  <PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
</BasePolicy>

It is also mentioned in the readme of the sample you linked to.

If you want to use this policy in production you should move the relevant parts to your own extension files.

phlo
  • 51
  • 3