Hello everybody!
Unfortunately it seems I encountered an issue in PAC4J SAML Single Logout, when using PAC4J 2.0.0 against Microsoft ADFS 2.
On a logout request, I got the following error in the log and the logout request did not succeed:
Event ID 368
The SAML Single Logout request does not correspond to the logged-in session participant.
Requestor: urn:idc:authentication:saml2:entity:cas:qa-2016:idcadfs
Request name identifier: Format: , NameQualifier: SPNameQualifier: , SPProvidedId:
Logged-in session participants:
Count: 1,
[ Issuer: urn:idc:authentication:saml2:entity:cas:qa-2016:idcadfs,
NameID: (Format: urn:oasis:names:tc:SAML:2.0:nameid-format:transient, NameQualifier: SPNameQualifier: , SPProvidedId: ) ]
ADFS does not like the difference in the NameID's format. From the original authentication, it remembers it was "urn:oasis:names:tc:SAML:2.0:nameid-format:transient". But the request does not contain it. Here is the relevant piece of the request XML:
...
<saml2:NameID xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">test1@xxxxxxxxx</saml2:NameID>
<saml2p:SessionIndex>_bb12e9c0-97f1-43a0-b409-c353d63fd8b1</saml2p:SessionIndex>
</saml2p:LogoutRequest>
So we can see the Format attribute is missing.
I think this could be fixed somewhere in SAML2LogoutRequestBuilder, probably in buildLogoutRequest() around lines 77-88, but unfortunately I don't know how exactly. Now I don't know where to take the Name ID format from. I see it's not part of SAML2Profile. Should it be? Or is there another place where it should be taken from?
Or maybe should this be solved in a completely different way?
Or, do you think the check on ADFS side could be somehow relaxed? I'm not aware of any way how to do that.
I found a couple of pages discussing this issue, mainly these:
Thank you very much for any comments!
Best Regards,
Jarda