-
Notifications
You must be signed in to change notification settings - Fork 6k
SEC-1986: Add remember-me support for CAS #2209
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
Comments
Jérôme Leleu said: I send the pull request #11 to ease code review. Some more explanations :
|
Rob Winch said: Thanks for the detailed submission. I will provide feedback within the next few days (most likely on the pull request as that simplifies commenting on code). |
Scott Battaglia said: Is there a link for the pull request? |
Jérôme Leleu said: Here it is : #14 |
ZhangLiangliang said: New to SSO, this is my opinion after googling and reviewing Spring Security 3.1.1 source code (I'm using cas-server-webapp 3.5.1), This has not been tested yet. Hope it working.
package org.springframework.security.core;
public interface RememberMeAuthentication extends Authentication {
}
<cas:attributes>
<cas:isFromNewLogin>${fn:escapeXml(assertion.fromNewLogin)}</cas:isFromNewLogin2> <%-- FIXME: attributen name should be? --%>
</cas:attributes>
public class CasRememberMeAuthenticationToken extends CasAuthenticationToken implements RememberMeAuthentication {
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
public CasRememberMeAuthenticationToken(final String key, final Object principal, final Object credentials,
final Collection<? extends GrantedAuthority> authorities, final UserDetails userDetails, final Assertion assertion) {
super(key, principal, credentials, authorities, userDetails, assertion);
}
}}
...
private CasAuthenticationToken authenticateNow(final Authentication authentication) throws AuthenticationException {
...
if(Boolean.TRUE.equals(assertion.getAttributes().get("isFromNewLogin"))){ // FIXME : the key is right?
return new CasRememberMeAuthenticationToken(this.key, userDetails, authentication.getCredentials(),
authoritiesMapper.mapAuthorities(userDetails.getAuthorities()), userDetails, assertion);
}
return ...;
...
}
...
Reference: |
Jérôme Leleu said: I didn't review your code, but the CAS fromNewLogin property does not have the expected behaviour. I invite you to read : #14. |
This issue depends on #2211 |
Jérôme Leleu (Migrated from SEC-1986) said:
Hi,
So far, the remember-me feature which can be enabled in CAS server is not handled in Spring Security when using the spring-security-cas module. In remember-me mode or not, the user is always considered fully authenticated.
That's what I'd like to change.
For that, I propose the following improvments :
I'm preparing a pull request on my fork : https://github.com/leleuj/spring-security. I'm working on integration tests right now.
Regarding code, in the spring-security-cas project, I created a org.springframework.security.cas.rememberme package and :
Before finishing and sending this pull request, I'd like to get a feedback from the Spring Security team.
Thanks.
Best regards,
Jérôme
The text was updated successfully, but these errors were encountered: