Skip to content

Howto call Azure AD B2C Change Password profile from Blazor WASM #42479

Closed as not planned
@njannink

Description

@njannink

Situation
Blazor WASM website that uses Azure AD B2C as authentication provider (MSAL)

Problem
I setup a custom policy for password change using the following guide:

https://docs.microsoft.com/en-us/azure/active-directory-b2c/add-password-change-policy?pivots=b2c-custom-policy

But I can't seem to figure out how to correctly redirect the user to the change password profile. If I call the suggested url:

https://xxxx.b2clogin.com/xxxx.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1A_PASSWORDCHANGE&client_id=ABCDE&nonce=defaultNonce&redirect_uri=https%3A%2F%2Flocalhost%3A5000%2Fauthentication%2Flogin-callback&scope=openid&response_type=id_token&prompt=login

Then I can login and change my password.

  1. If I remove the prompt=login it's not working at all. I would prefer if the user shouldn't have to login again and effectivly typing his old password twice.
  2. If I keep the prompt=login the password is updated, but the Blazor WASM authentication page keeps stuck in logging in. If I close the WASM site and reopen it I need to login another time. So the old used token is invalid.

Anybody has an idea howto correctly use Blazor WASM in combination with the change password custom policy?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions