-
Notifications
You must be signed in to change notification settings - Fork 6k
SEC-1987 & SEC-1986 #14
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
Conversation
Thanks for submitting the updates. I have provided some additional feedback below.
Thanks again for all your hard work and for your patience as we refine this feature. Cheers, |
SEC-2004: Upgrade CAS server to last release version : 3.5.0
I gave you all the information and ideas I have on my side : what do you expect from me to merge this pull request ? what is the next step ? |
The renew parameter indicates that it is re-authentication but it does not state why.
The problem is that the CasRememberMeAccessDeniedHandler does not even know why it failed. It only knows that authorization failed and that the user is marked as remember me. It also means that this is more of an edge case if they are using CAS remember me and may not be using this handler.
I am not surprised by SSO. I am surprised that the user is marked as remembered.
It seems inconsistent that the user is marked as remember me here. Typically remember me does not take place until after a session has timed out or until the browser has closed. In this instance the user was just active with the CAS server and they have not closed their browser. Why should the user have lower level privileges in this instance?
I perhaps could be persuaded on this point. The difference to me is that one is an explicit action and the other is implicit. Regardless, this still does not explain that if you have multiple applications why the second application is considered remember me. |
When trying to update the Spring Security CAS version I noticed a few more things:
Note: If you wan the gory details you can refer to the Spring Security Contributor Guidelines Obviously I can update the CAS Server version myself since it is a simple change, but then you wouldn't get credit in the commit logs :) If you want credit please make this a distinct commit, on it's own topic branch, it's own pull request, etc. |
As I commited both updates at the same time (tests and CAS server update), I changed the commit message with both JIRA referenced inside. But I notice all recommendations on topic branches. Do we really need to know if it's about remember me on CAS server side ? I don't see the need. The use of the CasRememberMeAccessDeniedHandler has to be configured according to the rest of the security configuration, it may (will ?) be tricky. OK, I got it now. I completely missed the point. I'm sorry about that. I will pause on SEC-1986 until I find a good solution on CAS server side. |
The updates for remember me (CAS server or CAS client/service) can be in a single commit. When I group my commits I try to think what is the theme of this commit (this one would be remember me support). If it doesn't fit in that theme, it should be in its own commit (i.e. CAS Server update). Another reason for a distinct commit is if it has value outside of the theme (i.e. RememberMeAware refactoring). Commits can be a bit more of the art side (i.e. not right/wrong) than the science side of programming. However, I try to stick to those rules for breaking up commits to make it easier to identify new features and to leverage tools like git bisect when issues do come up. |
Please note that the server isn't in "remember me mode". We have no "mode". What we have is, hey "this person requested a long term session, and since its not the initial sign on, we're letting you know they requested that." If you care, do something about it. Since each client has their own definition of at what point something is "remembered" and thus less trustworthy, they should be checking the time elapsed since the authentication. The flag is merely there to assist in determining whether they should bother to check. |
A link on CAS discussion : https://lists.wisc.edu/read/messages?id=18419320 |
I think that the new definition of remember me aligns with what I would have expected. It sounds like we all agree on this new definition, so the next step would be to update the pull request to correspond to this new definition. Specifically, we would need to
Let me know if this seems to align with what you both feel should be done. PS: Sorry for the delayed response. I had typed something up, but must have not sent it out and closed the tab instead. My apologies again. |
Looks good to me : first, I will work on CAS server side to return authentication creation time and, as soon as it will be ok, I will create a new pull request on Spring Security side. |
The SAML response should already be including authentication time. Is it not? |
You're right again Scott : it's included in the SAML response, but it's not pushed into the Assertion object... |
You mean the assertion in the CAS Java Client? If its not, if you open a JIRA issue I'll get it in there. I'm working through a number of other JIRA issues anyway :-) |
Right, I will open a JIRA and send a pull request (it's a small change)... |
If you wouldn't mind not sending a pull request, just yet, that would be good. I have a commit out to upgrade us to OpenSAML2 so your change won't work once that is merged in :-) |
No problem. I opened JIRA CASC-185. Let me know when I can work on the pull request. By the way, let's move back to the JIRA for discussion... |
Rob, the change has been done in Java CAS client. I'll be back as soon as it will be released... |
Thanks for the update and thanks for your patience as we iron things out. I know there has been quite a bit of back and forth, but I think our collaboration is already paying off; I hope you agree. Thanks again for the update. |
No problem. We're addressing very interesting issue and it takes time to find the best solution. |
@leleuj I'm just touching base on this Are the proper components released for this to move forward? |
I'm still willing to bring the CAS remember-me support in Spring Security. Though, things are taking a lot more time than expected. Explanations: As we have now a new endpoint in the CAS server 4.0.0 (/p3/serviceValidate) able to push user attributes, this one will be upgraded to also return remember-me information (apereo/cas#412). Target: CAS 4.1 (in a few months) Then, we could update the CAS client to retrieve remember-me information both from SAML and /p3 endpoints. I have no assurance about the planning, but that's the idea... |
Thanks for the fast reply @leleuj :) No problem on the timeline. I'm trying to get things prioritized and planned for the next Spring Security release and wanted to make sure I wasn't leaving you hanging on anything. I will wait till I hear back from you on this. |
@leleuj Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
@leleuj Any updates on getting this standardized? |
Thanks for the reminder. It's now fully feasible as the /p3 endpoint is a standard for CAS and returns a remember-me information. |
Update for changes in github pages
* | ||
* @throws IllegalArgumentException if a <code>null</code> was passed | ||
*/ | ||
public CasAuthenticationToken(final String key, final Object principal, final Object credentials, | ||
final Collection<? extends GrantedAuthority> authorities, final UserDetails userDetails, final Assertion assertion) { | ||
final Collection<? extends GrantedAuthority> authorities, final UserDetails userDetails, final Assertion assertion, |
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 constructor receives way too many parameters. Maybe consider a builder?
* | ||
* @throws IllegalArgumentException if a <code>null</code> was passed | ||
*/ | ||
public CasAuthenticationToken(final String key, final Object principal, final Object credentials, | ||
final Collection<? extends GrantedAuthority> authorities, final UserDetails userDetails, final Assertion assertion) { | ||
final Collection<? extends GrantedAuthority> authorities, final UserDetails userDetails, final Assertion assertion, | ||
String rememberMeAttributeName) { | ||
super(authorities); | ||
|
||
if ((key == null) || ("".equals(key)) || (principal == null) || "".equals(principal) || (credentials == null) |
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.
Instead of this long if for parameter validations could be used
Assert.notNull(myParameter, "myParamter must not be null"); which is a replacement for already java 8 Objects.requireNonNull()
|
||
final String urlEncodedService = createServiceUrl(servletRequest, response); | ||
final String redirectUrl = createRedirectUrl(urlEncodedService); | ||
final String redirectUrl = createRedirectUrl(urlEncodedService, forceRenew); |
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.
it's not a good practice to pass boolean as parameter, just add another explicit method for this case
|
||
Authentication laterResult = cap.authenticate(result); | ||
assertEquals(result, laterResult); | ||
} | ||
|
||
@Test | ||
public void testRememberMeDefaultAttributeName() throws Exception { |
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.
From the documentation of pull requests we shouldn't make smurfnamings: add preffix or suffix for method names with "test", but just say what we test
} | ||
|
||
@Test | ||
public void testRememberMeNewAttributeName() throws Exception { |
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.
From the documentation of pull requests we shouldn't make smurfnamings: add preffix or suffix for method names with "test", but just say what we test
0e114c6
to
fd244eb
Compare
Closing this as it has not been updated to use the standard CAS support. |
SEC-1987:
SEC-1986: