-
Notifications
You must be signed in to change notification settings - Fork 5
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 in automatic sign out after an interval of inactivity #652
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still trying to test this locally, will finish reviewing once I rehabilitate my environment
ui/src/app/core/auth.service.ts
Outdated
@@ -96,7 +115,47 @@ export class AuthService { | |||
return auth2.signOut(); | |||
} | |||
|
|||
private revokeToken(): Promise<any> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to specify a specific type instead of any
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was based on how signOut()
was implemented. I've now made signIn()
, signOut()
and revokeToken()
use the same pattern.
@@ -50,6 +63,12 @@ export class AuthService { | |||
if (!capabilities.authentication || !capabilities.authentication.isRequired) { | |||
return; | |||
} | |||
|
|||
if (capabilities.authentication.forcedLogoutDomains && capabilities.authentication.forcedLogoutTime && capabilities.authentication.forcedLogoutTime > (this.WARNING_INTERVAL * 2)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand the meaning of WARNING_INTERVAL * 2
.
Is it saying that if the forcedLogoutTime
is really short - only twice the warning interval - don't bother showing a warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a test of whether or not to show a warning, it's whether or not to set up the variables that will be used to force a logout after an idle period (see line 47).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we skip setting the variables if capabilities.authentication.forcedLogoutTime ≤ (this.WARNING_INTERVAL * 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was to guard against someone configuring the timeout to be an unreasonably short time and having the UI just keep logging users out. The only validation of capabilities.authentication.forcedLogoutTime
that's in place is that it needs to be a valid int
.
this.snackBar.dismiss(); | ||
|
||
this.warningTimer = window.setTimeout(() => { | ||
this.snackBar.open('You are about to be logged out due to inactivity'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be great to tell the user that they have 10 seconds in this message - it's pretty short compared to the one minute or 30 seconds I've seen elsewhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having the static value of "10 seconds" will be confusing to users. What if they only spot the message when they actually have only 5 seconds to go? Unfortunately, I haven't found a way to easily update the message in the SnackBar
component without closing it and opening it again, so I don't know how to show an actual countdown.
servers/cromwell/README.md
Outdated
"openid", | ||
"email", | ||
"profile" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ,
breaks JSON
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops – thanks for catching that; fixed
Auto-sign-out will be enabled if the
capabilities_config.json
contains the following in theauthentication
section:Closes #623