org.springframework.security.core.userdetails.UserDetailsChecker Java Examples

The following examples show how to use org.springframework.security.core.userdetails.UserDetailsChecker. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebAuthnAuthenticationProviderTest.java    From webauthn4j-spring-security with Apache License 2.0 6 votes vote down vote up
@Test
public void getter_setter_test() {
    WebAuthnUserDetailsService userDetailsService = mock(WebAuthnUserDetailsService.class);
    UserDetailsChecker preAuthenticationChecker = mock(UserDetailsChecker.class);
    UserDetailsChecker postAuthenticationChecker = mock(UserDetailsChecker.class);

    authenticationProvider.setForcePrincipalAsString(true);
    assertThat(authenticationProvider.isForcePrincipalAsString()).isTrue();
    authenticationProvider.setHideCredentialIdNotFoundExceptions(true);
    assertThat(authenticationProvider.isHideCredentialIdNotFoundExceptions()).isTrue();

    authenticationProvider.setUserDetailsService(userDetailsService);
    Assertions.assertThat(authenticationProvider.getUserDetailsService()).isEqualTo(userDetailsService);

    authenticationProvider.setPreAuthenticationChecks(preAuthenticationChecker);
    assertThat(authenticationProvider.getPreAuthenticationChecks()).isEqualTo(preAuthenticationChecker);
    authenticationProvider.setPostAuthenticationChecks(postAuthenticationChecker);
    assertThat(authenticationProvider.getPostAuthenticationChecks()).isEqualTo(postAuthenticationChecker);

}
 
Example #2
Source File: WebAuthnAuthenticationProvider.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
protected UserDetailsChecker getPreAuthenticationChecks() {
    return preAuthenticationChecks;
}
 
Example #3
Source File: WebAuthnAuthenticationProvider.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
protected UserDetailsChecker getPostAuthenticationChecks() {
    return postAuthenticationChecks;
}
 
Example #4
Source File: WebAuthnAuthenticationProvider.java    From webauthn4j-spring-security with Apache License 2.0 4 votes vote down vote up
public void setPostAuthenticationChecks(UserDetailsChecker postAuthenticationChecks) {
    this.postAuthenticationChecks = postAuthenticationChecks;
}
 
Example #5
Source File: AbstractUserDetailsAuthenticationProvider.java    From Taroco with Apache License 2.0 4 votes vote down vote up
protected UserDetailsChecker getPreAuthenticationChecks() {
    return this.preAuthenticationChecks;
}
 
Example #6
Source File: AbstractUserDetailsAuthenticationProvider.java    From Taroco with Apache License 2.0 4 votes vote down vote up
public void setPreAuthenticationChecks(UserDetailsChecker preAuthenticationChecks) {
    this.preAuthenticationChecks = preAuthenticationChecks;
}
 
Example #7
Source File: AbstractUserDetailsAuthenticationProvider.java    From Taroco with Apache License 2.0 4 votes vote down vote up
protected UserDetailsChecker getPostAuthenticationChecks() {
    return this.postAuthenticationChecks;
}
 
Example #8
Source File: AbstractUserDetailsAuthenticationProvider.java    From Taroco with Apache License 2.0 4 votes vote down vote up
public void setPostAuthenticationChecks(UserDetailsChecker postAuthenticationChecks) {
    this.postAuthenticationChecks = postAuthenticationChecks;
}
 
Example #9
Source File: FirebaseAuthenticationProvider.java    From zhcet-web with Apache License 2.0 4 votes vote down vote up
@Autowired(required = false)
public void setUserDetailsChecker(UserDetailsChecker userDetailsChecker) {
    this.userDetailsChecker = userDetailsChecker;
}
 
Example #10
Source File: TokenAuthenticationProvider.java    From molgenis with GNU Lesser General Public License v3.0 4 votes vote down vote up
public TokenAuthenticationProvider(
    TokenService tokenService, UserDetailsChecker userDetailsChecker) {
  this.tokenService = requireNonNull(tokenService);
  this.userDetailsChecker = requireNonNull(userDetailsChecker);
}
 
Example #11
Source File: RunAsUserTokenFactory.java    From molgenis with GNU Lesser General Public License v3.0 4 votes vote down vote up
public RunAsUserTokenFactory(UserDetailsChecker userDetailsChecker) {
  this.userDetailsChecker = requireNonNull(userDetailsChecker);
}
 
Example #12
Source File: MolgenisWebAppSecurityConfig.java    From molgenis with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Bean
public UserDetailsChecker userDetailsChecker() {
  return new MolgenisUserDetailsChecker();
}
 
Example #13
Source File: TokenAuthenticationProviderTest.java    From molgenis with GNU Lesser General Public License v3.0 4 votes vote down vote up
@BeforeEach
void beforeMethod() {
  tokenService = mock(TokenService.class);
  tokenAuthenticationProvider =
      new TokenAuthenticationProvider(tokenService, mock(UserDetailsChecker.class));
}
 
Example #14
Source File: RunAsUserTokenFactoryTest.java    From molgenis with GNU Lesser General Public License v3.0 4 votes vote down vote up
@BeforeEach
void setupBeforeMethod() {
  userDetailsChecker = mock(UserDetailsChecker.class);
  runAsUserTokenFactory = new RunAsUserTokenFactory(userDetailsChecker);
}
 
Example #15
Source File: WebAuthnAuthenticationProvider.java    From webauthn4j-spring-security with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the policy will be used to verify the status of the loaded
 * <code>UserDetails</code> <em>before</em> validation of the credentials takes place.
 *
 * @param preAuthenticationChecks strategy to be invoked prior to authentication.
 */
public void setPreAuthenticationChecks(UserDetailsChecker preAuthenticationChecks) {
    this.preAuthenticationChecks = preAuthenticationChecks;
}