Here we demonstrate how to integrate PlayFab's Users with Azure AD B2C using custom policies.
This sample includes the custom policies necessary for this integration, and an Azure Function that could work as an example of how to make Azure AD B2C and PlayFab interact.
If you are new to Azure AD B2C or custom policies, we recommend reading the following Microsoft documentation:
- What is Azure Active Directory B2C?
- Custom policies in Azure Active Directory B2C
- Get started with custom policies in Azure Active Directory B2C.
This diagram explains the flow of the Sign In / Sign Up custom policy.
Microsoft has a document that could help you understand how custom attributes work on custom policies.
We have defined our custom attributes on the TrustFrameworkExtensions.xml file.
These are updated on the PlayFabSUSI technical profile by defining them as OutputClaims
. This indicates that the attributes should be updated with the values returned by the API that has been triggered.
The appsettings.json is a configuration file that can be used to build custom policies with dynamic values.
To make this work, you should use the Azure AD B2C Visual Studio Code extension.
Once installed, you can build them by pressing CTRL + SHIFT + 5
.