@Test public void testExternalUserShouldBeUpdatedWhenExpired() { assertThat(strongboxUserManager.findByUsername(TEST_USER)).isNull(); assertThat(userDetailsService.loadUserByUsername(TEST_USER)).isNotNull(); User externalUser = strongboxUserManager.findByUsername(TEST_USER); String externalUserId = ((UserEntry)externalUser).getObjectId(); assertThat(externalUser).isNotNull(); assertThat(externalUserId).isNotNull(); User externalUserToSave = externalUser; assertThatExceptionOfType(IllegalStateException.class).isThrownBy(() -> orientDbUserService.save(externalUserToSave)) .withMessageMatching("Can't modify external users."); String newPassword = UUID.randomUUID().toString(); UserDto userToUpdate = new UserDto(); userToUpdate.setUsername(TEST_USER); userToUpdate.setPassword(newPassword); yamlUserService.updateAccountDetailsByUsername(new EncodedPasswordUser(userToUpdate, passwordEncoder)); expireUser(TEST_USER); assertThat(userDetailsService.loadUserByUsername(TEST_USER)).isNotNull(); externalUser = strongboxUserManager.findByUsername(TEST_USER); assertThat(externalUser).isNotNull(); assertThat(passwordEncoder.matches(newPassword, externalUser.getPassword())).isTrue(); assertThat(((UserEntry)externalUser).getObjectId()).isEqualTo(externalUserId); }
@Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return loadUserDetails(username).map(userDetailsMapper) .orElseThrow(() -> new UsernameNotFoundException(username)); }
ConfigurableProviderManager extends ProviderManager implements UserDetailsService, AuthenticationItemConfigurationManager { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return loadUserDetails(username).map(userDetailsMapper) .orElseThrow(() -> new UsernameNotFoundException(username)); } }
ConfigurableProviderManager extends ProviderManager implements UserDetailsService, AuthenticationItemConfigurationManager { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return loadUserDetails(username).map(userDetailsMapper) .orElseThrow(() -> new UsernameNotFoundException(username)); } ConfigurableProviderManager(); }
ConfigurableProviderManager extends ProviderManager implements UserDetailsService, AuthenticationItemConfigurationManager { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return loadUserDetails(username).map(userDetailsMapper) .orElseThrow(() -> new UsernameNotFoundException(username)); } ConfigurableProviderManager(); void reload(); @Override List<AuthenticationProvider> getProviders(); @Override UserDetails loadUserByUsername(String username); @Override Authentication authenticate(Authentication authentication); void reorder(String first,
                        String second); @Override void updateAuthenticationItems(AuthenticationItems items); @Override AuthenticationItems getAuthenticationItems(); @Override T getCustomAuthenticationItem(CustomAuthenticationItemMapper<T> mapper); @Override void putCustomAuthenticationItem(T customAuthenticationItem,
                                                CustomAuthenticationItemMapper<T> mapper); @Override void testCustomAuthenticationItem(T customAuthenticationItem,
                                                 CustomAuthenticationItemMapper<T> mapper,
                                                 Predicate<ApplicationContext> p); @EventListener({ ContextRefreshedEvent.class }) void contextRefreshedEvent(ContextRefreshedEvent e); }
ConfigurableProviderManager extends ProviderManager implements UserDetailsService, AuthenticationItemConfigurationManager { @Override public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { return loadUserDetails(username).map(userDetailsMapper) .orElseThrow(() -> new UsernameNotFoundException(username)); } ConfigurableProviderManager(); void reload(); @Override List<AuthenticationProvider> getProviders(); @Override UserDetails loadUserByUsername(String username); @Override Authentication authenticate(Authentication authentication); void reorder(String first,
                        String second); @Override void updateAuthenticationItems(AuthenticationItems items); @Override AuthenticationItems getAuthenticationItems(); @Override T getCustomAuthenticationItem(CustomAuthenticationItemMapper<T> mapper); @Override void putCustomAuthenticationItem(T customAuthenticationItem,
                                                CustomAuthenticationItemMapper<T> mapper); @Override void testCustomAuthenticationItem(T customAuthenticationItem,
                                                 CustomAuthenticationItemMapper<T> mapper,
                                                 Predicate<ApplicationContext> p); @EventListener({ ContextRefreshedEvent.class }) void contextRefreshedEvent(ContextRefreshedEvent e);  }