Hello @Aditya Gour (NAV India),
Thank you for posting your query on Microsoft Q&A.
Based on your description, it seems you want to include the email claim in the access token for Azure AD B2C. If you are trying to achieve this for your User Flow, please follow these steps:
- In your Azure AD B2C tenant, select User flows.
- Select your policy (for example, "B2C_1_SignupSignin") to open it.
- Select Application claims and then select the email address attribute.
- Select Save.
Once you've created a new user using the user flow, you can use the Run user flow feature on the user flow to verify the experience.
If you are working with a custom policy, follow these steps:
The Relying party policy technical profile output claims are values that are returned to an application. Adding output claims will issue the claims into the token after a successful user journey and will be sent to the application. Modify the technical profile element within the relying party section to add the desired claims as an output claim.
- Open your custom policy file. For example, SignUpOrSignin.xml.
- Find the OutputClaims element. Add the OutputClaim you want to be included in the token.
- Set the output claim attributes.
Add below as extra output claims in rely-party policy to return email from signInNames.emailAddress for B2C users.
<OutputClaim ClaimTypeReferenceId="email" />
For further details, refer to the following documentation:
Configure tokens in Azure AD B2C user flows: Configure tokens
Azure AD B2C access tokens: Access tokens
These resources should provide additional guidance on setting up and managing access tokens in Azure AD B2C.
I hope this information is helpful. Please feel free to reach out if you have any further questions.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.
Thanks,
Raja Pothuraju.