У меня есть установка с Azure B2C в качестве источника токена SAML и ADFS в качестве IdP SAML.
Application (service provider) -(SAML2)-> B2C (security token service relying party) -(SAML2)-> ADFS (identity provider)
Каждый раз, когда я пытаюсь войти в систему, появляется следующая ошибка B2C (в ADFS это не идет):
FatalException
Достигнут предел «20» для типа «Microsoft.Cpim.StateMachine.EventInstance».
Что это значит в B2C?Я что-то упустил в своей конфигурации издателя SAML Azure B2C?Вот моя политика входа в систему
<RelyingParty>
<DefaultUserJourney ReferenceId="SignUpOrSignInFmdClient" />
<UserJourneyBehaviors>
<SingleSignOn Scope="Application" />
<SessionExpiryType>Absolute</SessionExpiryType>
<SessionExpiryInSeconds>900</SessionExpiryInSeconds>
<JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="4f5ac312-eb9d-4395-b89d-ec6a6095b23e" DeveloperMode="true" ClientEnabled="false" ServerEnabled="true" TelemetryVersion="1.0.0" />
</UserJourneyBehaviors>
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="SAML2" />
<Metadata>
<Item Key="PartnerEntity"><![CDATA[
<md:EntityDescriptor xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" entityID="urn:itfoxtec:identity:saml2:testwebapp" validUntil="2026-12-27T23:42:22.079Z" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<md:SPSSODescriptor WantAssertionsSigned="true" protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol">
<md:NameIDFormat>urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified</md:NameIDFormat>
<md:AssertionConsumerService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" Location=https://localhost:8080" index="0" isDefault="true"/> </md:SPSSODescriptor> </md:EntityDescriptor>
]]>
</Item>
<Item Key="KeyEncryptionMethod">Rsa15</Item>
<Item Key="DataEncryptionMethod">Aes256</Item>
<Item Key="XmlSignatureAlgorithm">Sha256</Item>
</Metadata>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="socialIdpUserId" />
<OutputClaim ClaimTypeReferenceId="IdpUserGroups" />
<OutputClaim ClaimTypeReferenceId="IdpUserName"/>
<OutputClaim ClaimTypeReferenceId="identityProvider" />
<OutputClaim ClaimTypeReferenceId="userPrincipalName" PartnerClaimType="userPrincipalName" />
<OutputClaim ClaimTypeReferenceId="objectId"/>
</OutputClaims>
<!-- <SubjectNamingInfo ClaimType="userPrincipalName" /> -->
<!-- <SubjectNamingInfo ClaimType="http://schemas.microsoft.com/identity/claims/objectidentifier" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" ExcludeAsClaim="true"/> -->
<SubjectNamingInfo ClaimType="userPrincipalName" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" ExcludeAsClaim="false"/>
</TechnicalProfile>
Вот запрос Saml Auth, который я отправляю:
<samlp:AuthnRequest
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
ID="_b2d1a96864951d1d555e"
Version="2.0"
IssueInstant="2018-09-25T13:13:35.125Z"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
AssertionConsumerServiceURL="https://localhost:5000/auth/login"
Destination="https://login.microsoftonline.com /te/fmdclientsandbox.onmicrosoft.com/B2C_1A_SignUpOrSignInFmdClient/samlp/sso/login">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">21d60a4b-6e33-4e22-b618-586882744560</saml:Issuer>
<samlp:NameIDPolicy xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" AllowCreate="true"/>
<samlp:RequestedAuthnContext xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" Comparison="exact">
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/windows</saml:AuthnContextClassRef>
</samlp:RequestedAuthnContext>
`
Вот более подробныйСообщение об ошибке от B2C перехватывает App Insights {
""Kind"": ""Action"",
""Content"": ""Web.TPEngine.StateMachineHandlers.WarningExceptionTraceHandler""
},
{
""Kind"": ""HandlerResult"",
""Content"": {
""Result"": true
}
},
{
""Kind"": ""Action"",
""Content"": ""Web.TPEngine.SSO.SSOSessionEndHandler""
},
{
""Kind"": ""HandlerResult"",
""Content"": {
""Result"": true
}
},
{
""Kind"": ""Action"",
""Content"": ""Web.TPEngine.StateMachineHandlers.SendErrorHandler""
},
{
""Kind"": ""HandlerResult"",
""Content"": {
""Result"": true,
""PredicateResult"": ""True""
}
},
{
""Kind"": ""Transition"",
""Content"": {
""EventName"": ""Global"",
""StateName"": ""Microsoft.Cpim.Common.PolicyException""
}
},
{
""Kind"": ""Predicate"",
""Content"": ""Web.TPEngine.StateMachineHandlers.NoOpHandler""
},
{
""Kind"": ""HandlerResult"",
""Content"": {
""Result"": true,
""PredicateResult"": ""True""
}
},
{
""Kind"": ""Action"",
""Content"": ""Web.TPEngine.StateMachineHandlers.WarningExceptionTraceHandler""
},
{
""Kind"": ""HandlerResult"",
""Content"": {
""Result"": true
}
},
{
""Kind"": ""Action"",
""Content"": ""Web.TPEngine.SSO.SSOSessionEndHandler""
},
{
""Kind"": ""HandlerResult"",
""Content"": {
""Result"": true
}
},
{
""Kind"": ""Action"",
""Content"": ""Web.TPEngine.StateMachineHandlers.SendErrorHandler""
},
{
""Kind"": ""HandlerResult"",
""Content"": {
""Result"": true,
""PredicateResult"": ""True""
}
},
{
""Kind"": ""FatalException"",
""Content"": {
""Time"": ""1:50 PM"",
""Exception"": {
""Kind"": ""Handled"",
""HResult"": ""80131500"",
""Message"": ""The while limit of '20' has been reached for type 'Microsoft.Cpim.StateMachine.EventInstance'. ; Diagnostics="",
""Data"": {
""Event"": ""Global"",
""MachineDefinition"": """",
""StateTable"": """",
""Limit"": ""20"",
""ProcessingHistory"": ""Event:AUTH->Event:PreStep->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global->Event:Global""
}
}
}
}