Polish RememberMeConfigurer

Issue: gh-4140
This commit is contained in:
Eleftheria Stein 2019-11-07 15:26:59 +01:00
parent b13f750646
commit 1188a3bb5f
2 changed files with 10 additions and 3 deletions

View File

@ -167,6 +167,9 @@ public final class RememberMeConfigurer<H extends HttpSecurityBuilder<H>>
/** /**
* Sets the key to identify tokens created for remember me authentication. Default is * Sets the key to identify tokens created for remember me authentication. Default is
* a secure randomly generated key. * a secure randomly generated key.
* If {@link #rememberMeServices(RememberMeServices)} is specified and is of type
* {@link AbstractRememberMeServices}, then the default is the key set in
* {@link AbstractRememberMeServices}.
* *
* @param key the key to identify tokens created for remember me authentication * @param key the key to identify tokens created for remember me authentication
* @return the {@link RememberMeConfigurer} for further customization * @return the {@link RememberMeConfigurer} for further customization
@ -428,8 +431,12 @@ public final class RememberMeConfigurer<H extends HttpSecurityBuilder<H>>
} }
/** /**
* Gets the key to use for validating remember me tokens. Either the value passed into * Gets the key to use for validating remember me tokens. If a value was passed into
* {@link #key(String)}, or a secure random string if none was specified. * {@link #key(String)}, then that is returned.
* Alternatively, if a key was specified in the
* {@link #rememberMeServices(RememberMeServices)}}, then that is returned.
* If no key was specified in either of those cases, then a secure random string is
* generated.
* *
* @return the remember me key to use * @return the remember me key to use
*/ */

View File

@ -456,7 +456,7 @@ public class RememberMeConfigurerTests {
} }
@Test @Test
public void getWhenRememberMeCookieThenAuthenticationIsRememberMeAuthenticationTokenWithFallbackKeyConfiguration() public void getWhenRememberMeCookieAndNoKeyConfiguredThenKeyFromRememberMeServicesIsUsed()
throws Exception { throws Exception {
this.spring.register(FallbackRememberMeKeyConfig.class).autowire(); this.spring.register(FallbackRememberMeKeyConfig.class).autowire();