Repository navigation
REF-97 Bind the login to the SAML session and enforce a maximum session lifetime - #108
Merged
Merged
Conversation
…ssion length - A login ends MaximumSessionLength minutes (default 480) after the authentication at the IdP, or at the IdP's SessionNotOnOrAfter if earlier, whatever the activity; it is checked on every read. - The in-process and SQL Server session stores neither read nor extend an expired session, and writing to one starts it afresh. - Saml20Identity.IsInitialized() requires a completed login that has not ended, not just any value in the session. - The Forms ticket issued at login carries a hash of the OIOSAML session id and ends no later than the login; presented with another session it doesn't count as logged in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A login now belongs to the OIOSAML session it was made in and has a maximum length, as NemLog-in's technical requirements for service providers ask.
Changes
MaximumSessionLengthminutes after the authentication at the IdP (newFederationelement, default 480), or at the IdP'sSessionNotOnOrAfterif that is earlier, however active the user is. The end is stored with the login (Saml20AssertionLite.ValidUntil) and checked on every read.DisableCleanup).Saml20Identity.IsInitialized()is true only when the session holds a completed login that has not ended. Before, any value in the session, such as a pending AuthnRequest, made it true.SetSamlPrincipalaction issues the Forms ticket itself, with a hash of the OIOSAML session id in itsUserDataand an expiry no later than the login. A ticket presented with a different OIOSAML session doesn't count as logged in, so the documentedGlobal.asaxcheck signs it out. Tickets an application issues itself are left alone.readme.md: new "Session lifetime" section.Upgrade notes
ValidUntiland keep working until they time out.<MaximumSessionLength>in theFederationsection to change it.IsInitialized()is false between sending the AuthnRequest and receiving the response.UserDatais now set by the library; an application that needs its ownUserDatashould issue its own ticket in its own login action.Tests
SessionLifetimeTest(length calculation, expired in-process sessions) andSessionStoreTest(pre-login session, ended login, Forms tickets from this and other sessions).