Azure B2C - Bearer AccessToken not being generated when using ProfileEdit/PasswordReset custom policies using Local Accounts

Tommy 0 Reputation points
2025-05-01T15:15:13.46+00:00

I'm having some trouble getting the AccessToken to generate for the PasswordReset and ProfileEdit custom policies using Local Accounts.

It seems to work fine and generate the token correctly for SignIn/SignUp policies using the auto generated files I got from using https://b2ciefsetupapp.azurewebsites.net/, without any other changes required.

Steps I took:

  1. Generate files from [ https://b2ciefsetupapp.azurewebsites.net/]
  2. Added Token Endpoint to the RelyingParty block for PasswordReset & ProfileEdit custom policies as was already included in the SignUpSignIn policy.

I have tried including the Token endpoint to the other policies, as mentioned in the documentation linked below in the comments. But have had no luck with it so far.

This is my SIgnUpOrSignIn policy:User's image

This is my PasswordReset policy:User's image

I'm getting this in my .NET application:

User's image

User's image

Access token retrieval is working fine for SignIn/SignUp using the auto files from https://b2ciefsetupapp.azurewebsites.net/, and the .NET C# code above in the screenshot.

But I can't work out why the ProfileEdit & PasswordReset custom policies are not working. These were working fine previously when using user flows.

I have tested both policies using https://jwt.ms/ and the token is returned correctly for the scope I pass as a parameter in the code above. The only difference is when I run the Identity Experience Framework custom policy via the Azure portal, it forces me to sign in prior to sending me to the ProfileEdit / PasswordReset pages. Whereas in my web application, the user has already signed in at this point, then is taken straight to the page without requiring sign in again.

As an additional issue, i'm also having trouble getting the PasswordReset policy to return me the displayName, surname & givenName in the output claims. Is this something that is valid/accepted? Or should I be saving these values to my DB (already doing this), and using that instead. I can get these claims fine from the SignIn/SignUp/ProfileEdit custom policies but having no luck getting this to work with the PasswordReset policy.

If there is any documentation you can point me towards or any help you can give to resolve these issues, that would be much appreciated! Cheers Tom

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,703 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.