tngan / samlify

Node.js library for SAML SSO
https://samlify.js.org
MIT License
609 stars 217 forks source link

Problem with Auth0 redirect logout page #512

Open agonzaleznutra opened 1 year ago

agonzaleznutra commented 1 year ago

Hi!

I am calling createLogoutRequest as is set in tests, but when Auth0 receives the request it redirects to the issuer and returns the error "No active session(s) found matching LogoutRequest". I've checked all their forums and it seems to be because of an incoherence between NameID and SessionIndex that is sent and configured for the session that was created.

I am no expert in SAML but I think the problem is that in any part of samlify I could check what is my SessionIndex and NameID or was able to modify them so I wonder if there are any configurations to solve this.

air2 commented 7 months ago

I have auth0 logout working I have configured in my app:

//on login you do 
const parsed = this.sp.parseLoginResponse(...)
const info = {
    sessionId: parsed.extract.sessionIndex.sessionIndex,
    nameId: parsed.extract.nameID,
}
// store info in the session, to use on logout

const userInfo = {
    logoutNameID: info.nameId,
    sessionIndex: info.sessionId
}
const result = this.sp.createLogoutRequest(this.idp, 'redirect', userInfo)
const redirectUrl = result.context

in oauth I have configured in the SAML addon:

{
 "logout": {
    "callback": "https://..../saml/logout",
    "slo_enabled": true
  }
}