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

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

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

X509Configurer.<init>介绍

[英]Creates a new instance
[中]创建一个新实例

代码示例

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

/**
 * Configures X509 based pre authentication.
 *
 * <h2>Example Configuration</h2>
 *
 * The following configuration will attempt to extract the username from the X509
 * certificate. Remember that the Servlet Container will need to be configured to
 * request client certificates in order for this to work.
 *
 * <pre>
 * &#064;Configuration
 * &#064;EnableWebSecurity
 * public class X509SecurityConfig extends WebSecurityConfigurerAdapter {
 *
 *     &#064;Override
 *     protected void configure(HttpSecurity http) throws Exception {
 *         http.authorizeRequests().antMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;).and()
 *         // Example x509() configuration
 *                 .x509();
 *     }
 * }
 * </pre>
 *
 * @return the {@link X509Configurer} for further customizations
 * @throws Exception
 */
public X509Configurer<HttpSecurity> x509() throws Exception {
  return getOrApply(new X509Configurer<>());
}

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

/**
 * Configures X509 based pre authentication.
 *
 * <h2>Example Configuration</h2>
 *
 * The following configuration will attempt to extract the username from the X509
 * certificate. Remember that the Servlet Container will need to be configured to
 * request client certificates in order for this to work.
 *
 * <pre>
 * &#064;Configuration
 * &#064;EnableWebSecurity
 * public class X509SecurityConfig extends WebSecurityConfigurerAdapter {
 *
 *     &#064;Override
 *     protected void configure(HttpSecurity http) throws Exception {
 *         http.authorizeRequests().antMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;).and()
 *         // Example x509() configuration
 *                 .x509();
 *     }
 * }
 * </pre>
 *
 * @return the {@link X509Configurer} for further customizations
 * @throws Exception
 */
public X509Configurer<HttpSecurity> x509() throws Exception {
  return getOrApply(new X509Configurer<>());
}

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

/**
 * Configures X509 based pre authentication.
 *
 * <h2>Example Configuration</h2>
 *
 * The following configuration will attempt to extract the username from the X509
 * certificate. Remember that the Servlet Container will need to be configured to
 * request client certificates in order for this to work.
 *
 * <pre>
 * &#064;Configuration
 * &#064;EnableWebSecurity
 * public class X509SecurityConfig extends WebSecurityConfigurerAdapter {
 *
 *     &#064;Override
 *     protected void configure(HttpSecurity http) throws Exception {
 *         http.authorizeRequests().antMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;).and()
 *         // Example x509() configuration
 *                 .x509();
 *     }
 * }
 * </pre>
 *
 * @return the {@link X509Configurer} for further customizations
 * @throws Exception
 */
public X509Configurer<HttpSecurity> x509() throws Exception {
  return getOrApply(new X509Configurer<>());
}

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

return apply(new X509Configurer<HttpSecurity>());

相关文章