question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Log out with ADFS do not set session expire

See original GitHub issue

Hello, Could anyone can help me?. Currently i am integrating my app with ADFS on windows server 2016. When a user call a API to logout on API server. Server redirects to ADFS like below. -I also pointed the param logoutUrl on setting passport-saml to https://adfsserver.com/adfs/ls/ var samlStrategy = passport._strategy(‘saml’); samlStrategy.logout(req, function(err, requestUrl) { //redirect to the IdP with the encrypted SAML logout request res.redirect(requestUrl); }); I set up Logout End Point on ADFS to point to https://myapi.com/callback/logout to redirect to my api when user logout successfully on ADFS.

The problem is : ADFS return to my callback API with status samlp:Status<samlp:StatusCode Value=“urn:oasis:names:tc:SAML:2.0:status:Requester”/> then i redirect user to login page. but when user login again. they do not redirected to ADFS login page because ADFS did not set cookies expire on session when user logout.So ADFS know that user.

I debug on ADFS log and see error like bellow

  1. Exception details: System.ArgumentNullException: Value cannot be null. Parameter name: collection at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at Microsoft.IdentityServer.Web.Protocols.Saml.SamlProtocolHandler.ProcessSignOut(SamlContext samlContext, String redirectUri, List`1 iFrameUris, Boolean partialLogout)
  2. ADFS do not set cookies expire too.
  • So currently user can log in the app from ADFS, but they can not logout from ADFS.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hoainam1989commented, Oct 28, 2017

Hi All, I fixed the issue some months ago. I was missing some settings on ADFS server at that time. The Lib is working very well.

0reactions
patilmohan91commented, May 9, 2018

@hoainam1989 I am using Windows Server 2012 for ADFS. We have integrated ADFS in Android Application. But we don’t know how to logout? What settings we need to do? Also, I think there is no communication happening within API as relying party and ADFS Server. API is just parsing the BEARER and checking expiry time. I tried this by changing some characters from bearer and called the API and I surprised It is working? How? Please help to get rid of this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ADFS Session Expiration/Logout - TechNet - Microsoft
It will be possible for the user to come back to the app and be still logged in if the user knows the...
Read more >
How to properly handle logout request after session expires ...
The ADFS cookie lasts longer than the app session, so sometimes they will just be looped right back into the application. Pretty much...
Read more >
Redirect to ADFS login page after session timeout - ServiceNow
Currently, when the user session expires, due to no activity, they still stay on the same page. There is no indication to users...
Read more >
How to properly sign-out users when session times out on an ...
How to properly sign-out users when session times out on an MVC app using ADFS as authentication mechanism. Hi Community,. Today's post is...
Read more >
Configuring the ADFS logout page - IBM
When a user logs out of Resilient, the session index is passed back to ADFS so that ADFS know which session to expire....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found