config/src/main/java/org/springframework/security/config/annotation/web/configurers/RememberMeConfigurer.java
private UserDetailsService getUserDetailsService(H http) {
		if (this.userDetailsService == null) {
			this.userDetailsService = http.getSharedObject(UserDetailsService.class);
		}
		if (this.userDetailsService == null) {
			throw new IllegalStateException("userDetailsService cannot be null. Invoke "
					+ RememberMeConfigurer.class.getSimpleName()
					+ "#userDetailsService(UserDetailsService) or see its javadoc for alternative approaches.");
		}
		return this.userDetailsService;
	}
private UserDetailsService getUserDetailsService(H http) {
		if (this.userDetailsService == null) {
			this.userDetailsService = http.getSharedObject(UserDetailsService.class);
		}
		if (this.userDetailsService == null) {
			throw new IllegalStateException("userDetailsService cannot be null. Invoke "
					+ RememberMeConfigurer.class.getSimpleName()
					+ "#userDetailsService(UserDetailsService) or see its javadoc for alternative approaches.");
		}
		return this.userDetailsService;
	}
Gets the {@link UserDetailsService} to use. Either the explicitly configure
{@link UserDetailsService} from {@link #userDetailsService(UserDetailsService)} or
a shared object from {@link HttpSecurity#getSharedObject(Class)}.

@param http {@link HttpSecurity} to get the shared {@link UserDetailsService}
@return the {@link UserDetailsService} to use