Researching and testing out custom claims and policy in Azure AD B2C using Identity Experience Framework
- Get started with custom policies in Azure Active Directory B2C
- Set up sign-in with an Azure Active Directory account using custom policies in Azure Active Directory B2C
- Integrate REST API claims exchanges in your Azure AD B2C user journey as validation of user input
- Add REST API claims exchanges to custom policies in Azure Active Directory B2C
- Define a RESTful technical profile in an Azure Active Directory B2C custom policy
- Introduction to Azure AD B2C custom policies
- Azure Active Directory B2C: Use custom attributes in a custom profile edit policy
- Publish an ASP.NET Core app to Azure with Visual Studio Code
- Secure RESTful APIs with basic auth
- Secure RESTful APIs with certificate auth
- Azure Active Directory B2C: Use custom attributes in a custom profile edit policy
Before completing this section be sure to follow all of the steps in Get started with custom policies in Azure Active Directory B2C including all Prerequisites mentioned on that page.
Example API found in source code Contoso.AADB2C.API
Ensure the project will build by cd to this directory and run the following:
dotnet build
To provision an Azure App Service resource to host the API in Azure:
-
Ensure you have Azure CLI installed
-
Update the aadb2c.api.params.json file with the values for your environment
-
Run the command below (replace -g parameter with your resource group name)
az group deployment create ` --resource-group <your resource group name> ` --template-file ops\aadb2c.api.azuredeploy.json ` --parameters @ops\aadb2c.api.params.json
-
In the directory of the API project, prepare the project to be published
dotnet publish -c Release -o ./publish
-
In
VS Code
follow these steps:- Right click the
.publish
folder and select Deploy to Web App... - Select the subscription the existing Web App resides
- Select the Web App from the list
- Visual Studio Code will ask you if you want to overwrite the existing content. Click Deploy to confirm
- Right click the
You will need to update the custom policies in Azure AD B2C
- Follow all steps at Get started with custom policies in Azure Active Directory B2C to get familiar with the process
- The article Integrate REST API claims exchanges in your Azure AD B2C user journey as validation of user input will walk you through the changes you need to make but you can also reference the SocialAndLocalAccounts directory in this project
- If using the example in this project you will need to update the values
- Replace
yourtenant
with your actual b2c tenant - Replace
ProxyIdentityExperienceFrameworkAppId
with your App Id - Replace
IdentityExperienceFrameworkAppId
with your App Id - Replace
facebook_clientid
with your Facebook client Id - Replace
your-app-name
in the URLs provided with your app name
- Replace
- Upload to your Azure AD B2C via Identity Experience Framework