org.springframework.security.config.annotation.web.configurers.X509Configurer.authenticationUserDetailsService()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.springframework.security.config.annotation.web.configurers.X509Configurer.authenticationUserDetailsService()方法的一些代码示例,展示了X509Configurer.authenticationUserDetailsService()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X509Configurer.authenticationUserDetailsService()方法的具体详情如下:
包路径:org.springframework.security.config.annotation.web.configurers.X509Configurer
类名称:X509Configurer
方法名:authenticationUserDetailsService

X509Configurer.authenticationUserDetailsService介绍

[英]Specifies the AuthenticationUserDetailsService to use. If not specified, the shared UserDetailsService will be used to create a UserDetailsByNameServiceWrapper.
[中]指定要使用的AuthenticationUserDetails服务。如果未指定,共享UserDetailsService将用于创建UserDetailsByNameServiceWrapper。

代码示例

代码示例来源:origin: spring-projects/spring-security

/**
 * Shortcut for invoking
 * {@link #authenticationUserDetailsService(AuthenticationUserDetailsService)} with a
 * {@link UserDetailsByNameServiceWrapper}.
 *
 * @param userDetailsService the {@link UserDetailsService} to use
 * @return the {@link X509Configurer} for further customizations
 */
public X509Configurer<H> userDetailsService(UserDetailsService userDetailsService) {
  UserDetailsByNameServiceWrapper<PreAuthenticatedAuthenticationToken> authenticationUserDetailsService = new UserDetailsByNameServiceWrapper<>();
  authenticationUserDetailsService.setUserDetailsService(userDetailsService);
  return authenticationUserDetailsService(authenticationUserDetailsService);
}

代码示例来源:origin: org.springframework.security/spring-security-config

/**
 * Shortcut for invoking
 * {@link #authenticationUserDetailsService(AuthenticationUserDetailsService)} with a
 * {@link UserDetailsByNameServiceWrapper}.
 *
 * @param userDetailsService the {@link UserDetailsService} to use
 * @return the {@link X509Configurer} for further customizations
 */
public X509Configurer<H> userDetailsService(UserDetailsService userDetailsService) {
  UserDetailsByNameServiceWrapper<PreAuthenticatedAuthenticationToken> authenticationUserDetailsService = new UserDetailsByNameServiceWrapper<>();
  authenticationUserDetailsService.setUserDetailsService(userDetailsService);
  return authenticationUserDetailsService(authenticationUserDetailsService);
}

代码示例来源:origin: org.springframework.security/spring-security-javaconfig

/**
 * Shortcut for invoking {@link #authenticationUserDetailsService(AuthenticationUserDetailsService)} with a {@link UserDetailsByNameServiceWrapper}.
 *
 * @param userDetailsService the {@link UserDetailsService} to use
 * @return the {@link X509Configurer} for further customizations
 */
public X509Configurer<H> userDetailsService(
    UserDetailsService userDetailsService) {
  UserDetailsByNameServiceWrapper<PreAuthenticatedAuthenticationToken> authenticationUserDetailsService = new UserDetailsByNameServiceWrapper<PreAuthenticatedAuthenticationToken>();
  authenticationUserDetailsService.setUserDetailsService(userDetailsService);
  return authenticationUserDetailsService(authenticationUserDetailsService);
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Shortcut for invoking
 * {@link #authenticationUserDetailsService(AuthenticationUserDetailsService)} with a
 * {@link UserDetailsByNameServiceWrapper}.
 *
 * @param userDetailsService the {@link UserDetailsService} to use
 * @return the {@link X509Configurer} for further customizations
 */
public X509Configurer<H> userDetailsService(UserDetailsService userDetailsService) {
  UserDetailsByNameServiceWrapper<PreAuthenticatedAuthenticationToken> authenticationUserDetailsService = new UserDetailsByNameServiceWrapper<>();
  authenticationUserDetailsService.setUserDetailsService(userDetailsService);
  return authenticationUserDetailsService(authenticationUserDetailsService);
}

代码示例来源:origin: com.netflix.genie/genie-web

.anyRequest().authenticated()
  .and()
    .x509().authenticationUserDetailsService(this.x509UserDetailsService);
http
  .logout()

代码示例来源:origin: com.netflix.genie/genie-web

.anyRequest().hasRole(USER_ROLE)
.and()
  .x509().authenticationUserDetailsService(x509UserDetailsService)
.and()
  .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER)

相关文章