Can I use single Azure AD B2C tenant for DEV, STAGE and PROD environments of Django App?

Viewed 1301

I have three basic environments for my Django App. I wanna use Azure AD B2C as an Identity Provider for my app. But I'm a little confused about the followings points

Do we need to create a separate Azure AD B2C tenant for each environment? Like right now I have three environments for my Django app, so I will be creating 3 tenants.

Or if I use a single Azure AD B2C tenant, how will I be differentiating between DEV, STAGE, and PROD users?

Thanks in advance.

2 Answers

Just posting the way I answered that problem with my requirements, which were:

  • The Environment doesn't change anything for the user, it will connect with the same account no matter what
  • The claims values are different depending on the Environment
  • Avoid multiple tenants if possible

Basically I created a duplicate of user attribute with the format ATTRIBUTENAME_ENVIRONMENT for each possible environment, then duplicated my user flows for each environment, with the same USERFLOWNAME_ENVIRONMENT format, and only selected the correct claims to return in the token. That way, a user that connects with the signupsignin_Production user flow will get a token containing the attributes ending with _Production only.

Now in the configuration of my different projects, I just have a configuration variable ENV_SUFFIX that I append to any claim I want to use.

Related