-
Notifications
You must be signed in to change notification settings - Fork 251
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
KNOX-3077 - Add pac4j.cookie.max.age param #972
base: master
Are you sure you want to change the base?
Conversation
public static final String PAC4J_COOKIE_MAX_AGE = "pac4j.cookie.max.age"; | ||
|
||
/* default value is same is KNOXSSO token ttl default */ | ||
public static final int PAC4J_COOKIE_MAX_AGE_DEFAULT = -1; |
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 could - should - be private
(not used anywhere outside of this class) and String
instead of int
(i.e. "-1"
, to avoid unnecessary conversion below)
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.
Agreed! thanks for the review!
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.
@smolnar82 actually PAC4J_COOKIE_MAX_AGE
is used outside of this class in KnoxSessionStore
which needs this to be public.
I did update the int
to String
thanks for pointing it out!
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.
@moresandeep - yes, I know the parameter name is used elsewhere, that's why I added a comment on the default value only 😊
Thanks for applying the changes so quickly.
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
Please don't forget to file a Doc Jira with this new config. |
What changes were proposed in this pull request?
This PR introduces a new parameter
pac4j.cookie.max.age
for the Pac4J provider that enforces cookie age on the cookies created by the pac4j provider.e.g.
Note that these value needs to be same as
knoxsso.cookie.max.age
if you want Knox session to expire at the same time.How was this patch tested?
This patch was tested locally.