Created
March 26, 2014 09:09
-
-
Save robhinds/9779339 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomTokenBasedRememberMeService extends TokenBasedRememberMeServices{ | |
public CustomTokenBasedRememberMeService(String key, UserDetailsService userDetailsService) { | |
super(key, userDetailsService); | |
} | |
private final String HEADER_SECURITY_TOKEN = "Header name for token goes here"; | |
/** | |
* Locates the Spring Security remember me token in the request and returns its value. | |
* | |
* @param request the submitted request which is to be authenticated | |
* @return the value of the request header (which was originally provided by the cookie - API expects it in header) | |
*/ | |
@Override protected String extractRememberMeCookie(HttpServletRequest request) { | |
String token = request.getHeader(HEADER_SECURITY_TOKEN); | |
if ((token == null) || (token.length() == 0)) { | |
return null; | |
} | |
return token; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment