-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: follow new recommendation for idle/authentication timeouts #967
base: master
Are you sure you want to change the base?
Conversation
We set this inside Keycloak now, so it's not required here.
Coverage of commit
|
@@ -14,4 +22,19 @@ defmodule ArrowWeb.AuthManager do | |||
end | |||
|
|||
def resource_from_claims(_), do: {:error, :invalid_claims} | |||
|
|||
@impl true | |||
def verify_claims(%{"iat" => iat, "auth_time" => auth_time} = claims, _opts) do |
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.
Where do the iat
and auth_time
claims come from? I couldn't find any reference to them in ueberauth_oidcc
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.
auth_time
is coming from EntraID (via AuthController
), and iat
is from Guardian (all tokens have that claim).
roles: roles | ||
}, | ||
ttl: {expiration - current_time, :seconds} | ||
ttl: {1, :minute} |
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.
A TTL of one minute? Could you set this token to expire when the iat expires or the auth_time expires, whichever comes first? Or would that prevent revoking access to accounts that are deactivated in EntraID?
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.
Oh, is this so that you reset the 15 minute idle timeout (by having to refresh the token and get a new iat claim) on the next request after the 1m is up?
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.
Exactly; the 1 minute makes sure this token is valid long enough for the next request to be made, at which point the token will be refreshed. It would also work to use the idle timeout here, but then this module also needs to reference the idle timeout value so it seemed cleaner to avoid that.
Summary of changes
This aligns Arrow with the NIST SP 800-63 guidelines.
Reviewer Checklist