AADB2C90304: User journey went into a bad state. Claims exchange with id 'LocalAccountSigninEmailExchange' could not be found in orchestration step '2'.

Piyumi Nadeeshani 10 Reputation points
2023-07-23T04:46:21.7233333+00:00

Hi,

I am creating users using Microsoft Graph API as follows

var userToAddToAAD = new User
                {
                    AccountEnabled = true,
                    DisplayName = $"{firstName} {lastName}",
                    MailNickname = $"{firstName}{lastName[0]}",
                    PasswordProfile = new PasswordProfile
                    {
                        ForceChangePasswordNextSignIn = true,
                        Password = password
                    },
                    Identities = new List<ObjectIdentity>
                    {
                        new ObjectIdentity
                        {
                            SignInType = "emailAddress",
                            Issuer= _issuer,
                            IssuerAssignedId= emailAddress,
                        }
                    }
                };

                var scopes = new[] { "https://graph.microsoft.com/.default" };
                var clientSecretCredential = new ClientSecretCredential(_tenantId, _testboltDevClientApiClientId, _testboltDevClientApiClientSecret);
                var graphClient = new GraphServiceClient(clientSecretCredential, scopes);
                var newUser = await graphClient.Users.PostAsync(userToAddToAAD);


After new user sign in, i have to enable reset password flow. To do that I have created a custom polices as follows.

B2C_1A_TrustFrameworkBase.xml

With this, when user sign in I was able to redirect to password reset and then user can update the password. But after that I am getting following error.

User's image

I need a solution for this. Can someone help me to solve this?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,759 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,534 questions
{count} votes