Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add app setting logoutSessionsOnSensitiveChanges [2.x] #3109

Merged
merged 1 commit into from
Jan 20, 2017

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Jan 17, 2017

Description

Disable invalidation of access tokens by default to restore backwards compatibility with older 2.x versions.

Add a new application-wide flag logoutSessionsOnSensitiveChanges that can be used to explicitly turn on/off the token invalidation.

When the flag is not set, a verbose warning is printed to nudge the user to make a decision how they want to handle token invalidation.

Related issues

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@superkhau Please review
@crandmck Could you please review the warning? It's a long one, should we move some of the text into documentation and provide a link to docs in the warning?
@tvdstaaij @fabien PTAL too - will this solution work for you?

'',
'The user model %j is attached to an application that does not specify',
'whether other sessions should be invalidated when a password or',
'an email was changed. Invalidating sessions is important for security',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session invalidation is important for security reasons as it allows users to recover from various account breach situations.

'reasons, to allow users to recover from the situation where',
'an attacker got access to their account.',
'',
'We are recommending to turn this feature on by setting',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We recommend turning this feature on by...

'',
'We are recommending to turn this feature on by setting',
'"{{logoutSessionsOnSensitiveChanges}}" to {{true}} in',
'{{server/config.json}}, unless you have implemented your own solution',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

take out the , after }} and using (unless you've implemented your own solution for token invalidation).

'{{server/config.json}}, unless you have implemented your own solution',
'for token invalidation.',
'',
'You should also enable "{{injectOptionsFromRemoteContext}}" in %s\'s',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also recommend enabling

'',
'You should also enable "{{injectOptionsFromRemoteContext}}" in %s\'s',
'settings (typically via common/models/*.json file). This is',
'needed to allow the invalidation algorithm to keep the current',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setting is required for the invalidation...

@bajtos bajtos force-pushed the fix/flag-to-invalidate-tokens branch from dd657a9 to a91c96c Compare January 19, 2017 12:41
@bajtos
Copy link
Member Author

bajtos commented Jan 19, 2017

@superkhau fixed, LGTY now?

@crandmck ping

bajtos referenced this pull request Jan 19, 2017
Invalidate all existing sessions (delete all access tokens)
after user's password was changed.
'',
'The user model %j is attached to an application that does not specify',
'whether other sessions should be invalidated when a password or',
'an email was changed. Session invalidation is important for security',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

email has changed

Copy link
Contributor

@superkhau superkhau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor sentence fixes, LGTM.

'reasons as it allows users to recover from various account breach',
'situations.',
'',
'We recommend to turn this feature on by setting',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we recommend turning this feature

Disable invalidation of access tokens by default to restore backwards
compatibility with older 2.x versions.

Add a new application-wide flag logoutSessionsOnSensitiveChanges
that can be used to explicitly turn on/off the token invalidation.

When the flag is not set, a verbose warning is printed to nudge the user
to make a decision how they want to handle token invalidation.
@bajtos
Copy link
Member Author

bajtos commented Jan 20, 2017

@slnode test please

@slnode loopback/node=0.10,os=windows — Failed! (f1e31ca)
http://ci.strongloop.com/job/loopback/node=0.10,os=windows/5905/

AFAICT, the build failure is unrelated, let's run the build again to see if it was intermittent.

@bajtos bajtos merged commit b541c5b into 2.x Jan 20, 2017
@bajtos bajtos deleted the fix/flag-to-invalidate-tokens branch January 20, 2017 14:09
@bajtos bajtos changed the title Add app setting logoutSessionsOnSensitiveChanges Add app setting logoutSessionsOnSensitiveChanges [2.x] Jan 20, 2017
@michaelfreund
Copy link

@bajtos you should attach docs (links) to such changes (preferably in changelog.md) not only log console outputs. so we can better figure out what's going on exactly and how those changes work. could you please provide some more information? ty

@bajtos
Copy link
Member Author

bajtos commented Jan 24, 2017

@michaelfreund thank you for the feedback, I did have the feeling that adding a warning may not be sufficient. I'd like to update the documentation ASAP. In the meantime, please take a look at my #3112 (comment) and let me know if there is any more information to help LoopBack users with the upgrade (preferably by posting comments in #3112).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants