# Getting "No active session(s) found matching LogoutRequest" when trying to do logout request with SAML

**URL:** <https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420>\
**Category:** Get Help\
**Tags:** saml2, saml\
**Created:** [November 28, 2018, 3:24am UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420 "2018-11-28T03:24:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gwynjudd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwynjudd/32/9836_2.png) [@gwynjudd](https://community.auth0.com/u/gwynjudd)\
**Post date:** [November 28, 2018, 3:24am UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/1 "2018-11-28T03:24:27Z")

</div>

I’m getting the above error when submitting a LogoutRequest. The LogoutRequest is shown below:

`<LogoutRequest Version="2.0" IssueInstant="2018-11-28T03:21:08Z" ID="id88cbb3c694bd4958bded1628123e33d3" xmlns="urn:oasis:names:tc:SAML:2.0:protocol"><Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">urn:sif-touch-dev.au.auth0.com</Issuer><NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified" xmlns="urn:oasis:names:tc:SAML:2.0:assertion">auth0|5a4557c041bc7b2bc7a7c101</NameID><SessionIndex>_J2JaGGovaenR-4GeO9Z6ntsMy2wrJdoh</SessionIndex></LogoutRequest>`

The NameID, Issuer and SessionIndex are copied from the assertion in the SAML response.

The LogoutRequest is submitted by the following form:

```
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 
<body onload="document.forms[0].submit()">
	<noscript> 
		<p><strong>Note:</strong> Since your browser does not support JavaScript, you must press the Continue button once to proceed. </p> 
	</noscript>
	<form action="https://sif-touch-dev.au.auth0.com/samlp/OsLpNhHHoBqMux45oh6fnSvA8ESyHGBW/logout" method="post">
		<div>
			<input type="hidden" name="SAMLRequest" value="PExvZ291dFJlcXVlc3QgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMTgtMTEtMjhUMDM6MjE6MDhaIiBJRD0iaWQ4OGNiYjNjNjk0YmQ0OTU4YmRlZDE2MjgxMjNlMzNkMyIgeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDpwcm90b2NvbCI+PElzc3VlciB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiI+dXJuOnNpZi10b3VjaC1kZXYuYXUuYXV0aDAuY29tPC9Jc3N1ZXI+PE5hbWVJRCBGb3JtYXQ9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjEuMTpuYW1laWQtZm9ybWF0OnVuc3BlY2lmaWVkIiB4bWxucz0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmFzc2VydGlvbiI+YXV0aDB8NWE0NTU3YzA0MWJjN2IyYmM3YTdjMTAxPC9OYW1lSUQ+PFNlc3Npb25JbmRleD5fSjJKYUdHb3ZhZW5SLTRHZU85WjZudHNNeTJ3ckpkb2g8L1Nlc3Npb25JbmRleD48L0xvZ291dFJlcXVlc3Q+"/>
		</div> 
		<noscript> 
			<div> 
				<input type="submit" value="Continue"/> 
			</div> 
		</noscript> 
	</form> 
</body>
</html>

```

Any assistance would be much appreciated to get me past this.

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [November 28, 2018, 10:27am UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/2 "2018-11-28T10:27:34Z")

</div>

Can you provide the full SAML response from the authentication? Or, ideally, a [.HAR file](https://auth0.com/docs/har) with the login and subsequent logout attempt (be sure to remove any passwords from the file).

---

<div class="post-metadata">

**Author:** ![gwynjudd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwynjudd/32/9836_2.png) [@gwynjudd](https://community.auth0.com/u/gwynjudd)\
**Post date:** [November 28, 2018, 6:08pm UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/3 "2018-11-28T18:08:40Z")

</div>

[sif-touch-dev.au.auth0.com.har](https://global.discourse-cdn.com/auth0/original/2X/5/530d7e1c65ebc90be25e8f1d660247539754cebe.har) (1.8 MB)

@nicolas_sabena I have attached an .HAR file. There is no sensitive data, it is just a system we use for test purposes.

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [November 28, 2018, 6:36pm UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/4 "2018-11-28T18:36:30Z")

</div>

When looking for valid sessions to terminate, we are looking for a match on three things:

- The `NameID`
- The `SessionIndex`
- The `Issuer` (which we compare against the `audience` configured in the SAML add on for the application)

The `audience` you have configured in the SAML addon is `urn:example`, but the audience used in the SAML requests from the SP reads `urn:sif-touch-dev.au.auth0.com`.

To avoid confusions, avoid using `urn:sif-touch-dev.au.auth0.com`, which is the identifier for the Auth0 side (the identity provider), and use a different identifier for your application (SP). Make sure to use this new identifier both in the `audience` setting of the addon, and on the SAML requests.

Let me know how it goes after changing that.

---

<div class="post-metadata">

**Author:** ![gwynjudd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwynjudd/32/9836_2.png) [@gwynjudd](https://community.auth0.com/u/gwynjudd)\
**Post date:** [November 28, 2018, 7:31pm UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/5 "2018-11-28T19:31:56Z")

</div>

thanks @nicolas_sabena. I have tried changing the audience in the SAML add-on configuration and the issue to the value “urn:gwyn10.dev.stayinfront.com”. I am still seeing the same issue (“No active session(s) found matching LogoutRequest”).

Here is the decoded LogoutRequest:

`<LogoutRequest Version="2.0" IssueInstant="2018-11-28T19:23:21Z" ID="id4e221229a19449bc84f0cae4e1e5c7d4" xmlns="urn:oasis:names:tc:SAML:2.0:protocol"><Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">urn:gwyn10.dev.stayinfront.com</Issuer><NameID xmlns="urn:oasis:names:tc:SAML:2.0:assertion">auth0|5a4557c041bc7b2bc7a7c101</NameID><SessionIndex>auth0|5a4557c041bc7b2bc7a7c101</SessionIndex></LogoutRequest>`

Here is the SAML add-on configuration:

```
{
  "audience": "urn:gwyn10.dev.stayinfront.com",
  "recipient": "http://example.com",
  "mappings": {
    "user_id": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
    "email": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
    "name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
    "given_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
    "family_name": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
    "upn": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn",
    "groups": "http://schemas.xmlsoap.org/claims/Group"
  },
  "createUpnClaim": true,
  "passthroughClaimsWithNoMapping": true,
  "mapUnknownClaimsAsIs": false,
  "mapIdentities": true,
  "signatureAlgorithm": "rsa-sha1",
  "digestAlgorithm": "sha1",
  "destination": "http://example.com",
  "lifetimeInSeconds": 3600,
  "signResponse": false,
  "typedAttributes": true,
  "includeAttributeNameFormat": true,
  "nameIdentifierFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
  "nameIdentifierProbes": [
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
    "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
  ],
  "authnContextClassRef": "urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified",
  "logout": {
    "callback": "https://gwyn10.dev.stayinfront.com/touch/",
    "slo_enabled": false
  },
  "binding": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
}

```

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [November 28, 2018, 7:37pm UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/6 "2018-11-28T19:37:11Z")

</div>

New .HAR please 😃. Sorry!

---

<div class="post-metadata">

**Author:** ![gwynjudd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwynjudd/32/9836_2.png) [@gwynjudd](https://community.auth0.com/u/gwynjudd)\
**Post date:** [November 28, 2018, 7:51pm UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/7 "2018-11-28T19:51:11Z")

</div>

@nicolas_sabena .har file is attached, thanks for your assistance

[sif-touch-dev.au.auth0.com.har](https://global.discourse-cdn.com/auth0/original/2X/5/52b3a27e56f0c528bb4a98f5d83e7b9b5b3b9120.har) (1.1 MB)

---

<div class="post-metadata">

**Author:** ![gwynjudd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gwynjudd/32/9836_2.png) [@gwynjudd](https://community.auth0.com/u/gwynjudd)\
**Post date:** [November 28, 2018, 8:02pm UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/8 "2018-11-28T20:02:57Z")

</div>

@nicolas_sabena sorry I believe it is working for me now. I found an issue with my last LogoutRequest, I was sending the NameID value in place of the SessionIndex. I resolved that at my end and I have now been able to successfully logout

---

<div class="post-metadata">

**Author:** ![nicolas\_sabena](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nicolas_sabena/32/6064_2.png) [@nicolas\_sabena](https://community.auth0.com/u/nicolas_sabena)\
**Post date:** [November 28, 2018, 8:24pm UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/9 "2018-11-28T20:24:06Z")

</div>

No worries, glad it worked!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [August 28, 2019, 12:15pm UTC](https://community.auth0.com/t/getting-no-active-session-s-found-matching-logoutrequest-when-trying-to-do-logout-request-with-saml/18420/10 "2019-08-28T12:15:35Z")

</div>


