Skip to content
This repository was archived by the owner on Nov 29, 2022. It is now read-only.
This repository was archived by the owner on Nov 29, 2022. It is now read-only.

SES-159: Single Logout Problems with Logout Request Issued by the IDP. #137

Open
@spring-projects-issues

Description

@spring-projects-issues

Hubert Wagener (Migrated from SES-159) said:

SingleLogout is not functional.

Logout requests issued by the IDP fail.

More verbose:
Consider in the SingleLogout the IDP sent a logout request like

<?xml version="1.0" encoding="UTF-8"?>
<saml2p:LogoutRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol" Destination="http://localhost:8080/security-sso/saml/SingleLogout" ID="ejbloofedgbpinebbeioijllbigpobecghaajlkd" IssueInstant="2015-02-02T10:20:16.090Z" NotOnOrAfter="2015-02-02T10:25:16.090Z" Reason="urn:oasis:names:tc:SAML:2.0:logout:user" Version="2.0">
  <saml2:Issuer xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
    https://localhost:9443/samlsso
  </saml2:Issuer>
  <saml2:NameID xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:entity">
    [email protected]
  </saml2:NameID>
  <saml2p:SessionIndex>
    fd011a38-32bb-48eb-9a59-253b5ddf531f
  </saml2p:SessionIndex>
</saml2p:LogoutRequest>  

In SAMLLogoutProcessingFilter.processLogout(..) the credential are computed as

Authentication auth = SecurityContextHolder.getContext().getAuthentication();
SAMLCredential credential = null;
      if (auth != null) {
              credential = (SAMLCredential) auth.getCredentials();
      }

Actually I don't understand how (and where) the credentials of the user " [email protected]" are (or should be) put into the security context when called from the IDP like given above.

What happens is: The logout request fails with an exception (due to null credential) thrown at:

SingleLogoutProfileImpl.processLogoutRequest(...)

...
// Check whether any user is logged in
        if (credential == null) {
            throw new SAMLStatusException(StatusCode.UNKNOWN_PRINCIPAL_URI, "No user is logged in");
        }

Sure the session of the user should be destroyed, but I don't see where this case is considered in the code. Can you please help in understanding?

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: coreAn issue in spring-security-saml-corestatus: ideal-for-contributionAn issue that we are actively looking for help withtype: bugA general bugtype: jiraAn issue that was migrated from JIRA

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions