To add a custom claim in a SharePoint Online web client extensibility app, you can utilize the Microsoft Entra ID features for customizing claims in the tokens. Here are the general steps you can follow:
- Sign in to the Microsoft Entra admin center: Go to the Entra admin center and sign in with your admin account.
- Navigate to App registrations: Browse to Entra ID > App registrations and select your application from the list.
- Manage Attributes & Claims: Under the Manage section, select Single Sign-on and then go to the Attributes & Claims section.
- Add a Custom Claim:
- Select Add new claim.
- Enter a Name for your custom claim.
- Choose Directory schema extension as the source.
- Select the appropriate application that contains your extension attributes (e.g.,
b2c-extensions-app) and choose the custom attribute you want to add. - Save your changes.
- Update the Application Manifest: Ensure that the application manifest is updated to accept mapped claims by setting the
acceptMappedClaimskey to true.
By following these steps, you should be able to pass a custom claim in the token, which can then be used to capture the user's location or any other required information.
References: