We are using Azure B2C as our IdP. We have created custom policies for registration, login and credential management. As part of the registration and login we call REST APIs provided by our back office software. The User Journeys are set up to call the REST API just once. We have seen in Application Insights that the REST APIs are occasionally called several times, usually with the correct data and again with just the object ID.
I have googled extensively and asked on the learn.microsft.com site, but I don't see any reason why the REST API is called several times. There is a retry mechanism in B2C that will try the call again after 30 seconds, but we know it is not this being triggered.
I would appreciate any help as this issue is driving the team nuts!
The output of Application Insights is:
Application Insights
Policy: b2c_1a_signin
Correlation Id: 6618ff5f-c65b-4421-8f5d-f0a7fa...
App insights timestamp: 2022-11-24 13:47:56
User journey is completed: No
Orchestration steps: 2, 3
Exceptions
Processing of the HTTP request resulted in an exception.
Please see the HTTP response returned by the 'Response' property of this exception for details.
Cannot process your login right now, please try again later.
Technical profiles
SelfAsserted-LocalAccountSignin-Email_2 (SelfAssertedAttributeProvider)
TFPGQL-SendLoginMutation (RestfulProvider)
TFPGQL-SendLoginMutation (RestfulProvider) <--- CALLED TWICE
Claims
authenticationSource: localAccountAuthentication
gqlLoginJsonBody: {"subjectId":"b456720d-b9e9-...."}
ipAddress: 185.xxx.xxx.177
objectId: b456720d-b9e9-4ec0-9e9...
objectIdFromSession: True
signInName: trdt2411005@mailinator.com
The technical profile we are using is
<ClaimsTransformation Id="GenerateLoginBody" TransformationMethod="GenerateJson">
<InputClaims>
<InputClaim ClaimTypeReferenceId="objectId" TransformationClaimType="subjectId" />
<InputClaim ClaimTypeReferenceId="blackBox" TransformationClaimType="blackBox" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="gqlLoginJsonBody" TransformationClaimType="outputClaim" />
</OutputClaims>
</ClaimsTransformation>
<TechnicalProfile Id="TFPGQL-SendLoginMutation">
<DisplayName>Send register request to GQL</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.RestfulProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ServiceUrl">https://tpappgw.thepools.com/qa_graphql/rest/login</Item>
<Item Key="AuthenticationType">ClientCertificate</Item>
<Item Key="SendClaimsIn">Body</Item>
<Item Key="ClaimUsedForRequestPayload">gqlLoginJsonBody</Item>
<Item Key="DefaultUserMessageIfRequestFailed">Cannot process your login right now.</Item>
<Item Key="IncludeClaimResolvingInClaimsHandling">true</Item>
<Item Key="DebugMode">true</Item>
</Metadata>
<CryptographicKeys>
<Key Id="ClientCertificate" StorageReferenceId="B2C_1A_RestApiClientCertificate" />
</CryptographicKeys>
<InputClaimsTransformations>
<InputClaimsTransformation ReferenceId="GenerateLoginBody" />
</InputClaimsTransformations>
<InputClaims>
<InputClaim ClaimTypeReferenceId="ipAddress" DefaultValue="{Context:IPAddress}" AlwaysUseDefaultValue="true" />
<InputClaim ClaimTypeReferenceId="gqlLoginJsonBody" />
</InputClaims>
<PersistedClaims>
<PersistedClaim ClaimTypeReferenceId="ipAddress"/>
<PersistedClaim ClaimTypeReferenceId="blackBox" />
<PersistedClaim ClaimTypeReferenceId="subjectId" />
<PersistedClaim ClaimTypeReferenceId="loginSuccess" />
<PersistedClaim ClaimTypeReferenceId="userBlocked" />
<PersistedClaim ClaimTypeReferenceId="ioResult" />
<PersistedClaim ClaimTypeReferenceId="loginErrorMessage" />
<PersistedClaim ClaimTypeReferenceId="fsError" />
<PersistedClaim ClaimTypeReferenceId="migrationResponse" />
</PersistedClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="loginSuccess" />
<OutputClaim ClaimTypeReferenceId="userBlocked" />
<OutputClaim ClaimTypeReferenceId="ioResult" />
<OutputClaim ClaimTypeReferenceId="loginErrorMessage" PartnerClaimType="error.message" />
<OutputClaim ClaimTypeReferenceId="fsError" PartnerClaimType="error.fsError" />
<OutputClaim ClaimTypeReferenceId="migrationResponse" />
<OutputClaim ClaimTypeReferenceId="subjectId" />
<OutputClaim ClaimTypeReferenceId="fsId" />
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-Noop" />
</TechnicalProfile>
We have investigated the problem and cannot find a reason for the repeat call