当前位置: 首页>>代码示例>>Java>>正文


Java AuthenticationManagerBuilder.authenticationProvider方法代码示例

本文整理汇总了Java中org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder.authenticationProvider方法的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationManagerBuilder.authenticationProvider方法的具体用法?Java AuthenticationManagerBuilder.authenticationProvider怎么用?Java AuthenticationManagerBuilder.authenticationProvider使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder的用法示例。


在下文中一共展示了AuthenticationManagerBuilder.authenticationProvider方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configureGlobal

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    if (settingsService.isLdapEnabled()) {
        auth.ldapAuthentication()
                .contextSource()
                    .managerDn(settingsService.getLdapManagerDn())
                    .managerPassword(settingsService.getLdapManagerPassword())
                    .url(settingsService.getLdapUrl())
                .and()
                .userSearchFilter(settingsService.getLdapSearchFilter())
                .userDetailsContextMapper(customUserDetailsContextMapper);
    }
    auth.userDetailsService(securityService);
    String jwtKey = settingsService.getJWTKey();
    if(StringUtils.isBlank(jwtKey)) {
        logger.warn("Generating new jwt key");
        jwtKey = JWTSecurityService.generateKey();
        settingsService.setJWTKey(jwtKey);
        settingsService.save();
    }
    auth.authenticationProvider(new JWTAuthenticationProvider(jwtKey));
}
 
开发者ID:airsonic,项目名称:airsonic,代码行数:23,代码来源:GlobalSecurityConfig.java

示例2: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
  protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// without salt
   //auth.userDetailsService(userDetailsService).passwordEncoder(md5PasswordEncoder());

// with salt
auth.authenticationProvider(authProvider());
auth.eraseCredentials(false);
  }
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:10,代码来源:AppSecurityModelE2.java

示例3: configureGlobal

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(myUserDetailService);
        auth.authenticationProvider(rememberMeAuthenticationProvider());
//        auth.jdbcAuthentication()
//                .dataSource(dataSource)
//                .withUser("user").password("password").roles("USER").and()
//                .withUser("admin").password("password").roles("USER", "ADMIN");
    }
 
开发者ID:AgainstWind,项目名称:spring-cloud-demos,代码行数:10,代码来源:SecurityConfig.java

示例4: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    auth.authenticationProvider(authenticationProvider);
}
 
开发者ID:jeikerxiao,项目名称:SpringBootStudy,代码行数:5,代码来源:JsonWebTokenSecurityConfig.java

示例5: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
  auth.authenticationProvider(new JwtAuthenticationProvider());
  customizeAuthenticationManager(auth);
}
 
开发者ID:springuni,项目名称:springuni-particles,代码行数:6,代码来源:SecurityConfigurationSupport.java

示例6: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) {
    auth.authenticationProvider(agentAuthenticationProvider);
    auth.authenticationProvider(jwtAuthenticationProvider);
}
 
开发者ID:kinota,项目名称:kinota-server,代码行数:6,代码来源:WebSecurityConfig.java

示例7: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
  protected void configure(AuthenticationManagerBuilder auth) throws Exception {    
auth.authenticationProvider(authProvider());
auth.eraseCredentials(false);
  }
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:6,代码来源:AppSecurityModelG.java

示例8: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
  protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(authProvider());
auth.eraseCredentials(false);
  }
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:6,代码来源:AppSecurityModelJ.java

示例9: customizeAuthenticationManager

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void customizeAuthenticationManager(AuthenticationManagerBuilder auth) {
  AuthenticationProvider usernamePasswordAuthenticationProvider =
      lookup("usernamePasswordAuthenticationProvider");
  auth.authenticationProvider(usernamePasswordAuthenticationProvider);
}
 
开发者ID:springuni,项目名称:springuni-particles,代码行数:7,代码来源:AuthSecurityConfiguration.java

示例10: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(final AuthenticationManagerBuilder auth) throws Exception {
    auth.userDetailsService(userDetailsService);
    auth.authenticationProvider(accountAuthenticationProvider);
}
 
开发者ID:zeldan,项目名称:spring-boot-oauth2-password-flow,代码行数:6,代码来源:WebSecurityConfiguration.java

示例11: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder authBuilder) {
	authBuilder.authenticationProvider(this.authProvider);
}
 
开发者ID:PacktPublishing,项目名称:Building-Web-Apps-with-Spring-5-and-Angular,代码行数:5,代码来源:SecurityConfiguration.java

示例12: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
	// Database authentication provider
	auth.authenticationProvider(authenticationProvider);
}
 
开发者ID:arubioVK,项目名称:La-Apostada,代码行数:6,代码来源:SecurityConfiguration.java

示例13: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
@Override
protected void configure(AuthenticationManagerBuilder auth) {
    auth.authenticationProvider(ajaxAuthenticationProvider);
    auth.authenticationProvider(jwtAuthenticationProvider);
}
 
开发者ID:mjfcolas,项目名称:infotaf,代码行数:6,代码来源:WebSecurityConfig.java

示例14: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
/**
 * Configure AuthenticationManager.
 *
 * NOTE:
 * Due to a known limitation with JavaConfig:
 * <a href="https://jira.spring.io/browse/SPR-13779">
 *     https://jira.spring.io/browse/SPR-13779</a>
 *
 * We cannot use the following to expose a {@link UserDetailsManager}
 * <pre>
 *     http.authorizeRequests()
 * </pre>
 *
 * In order to expose {@link UserDetailsManager} as a bean, we must create  @Bean
 *
 * @see {@link super.userDetailsService()}
 * @see {@link com.packtpub.springsecurity.service.DefaultCalendarService}
 *
 * @param auth       AuthenticationManagerBuilder
 * @throws Exception Authentication exception
 */
@Override
public void configure(final AuthenticationManagerBuilder auth) throws Exception {
    auth
            .authenticationProvider(calendarUserAuthenticationProvider)
    ;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:28,代码来源:SecurityConfig.java

示例15: configure

import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; //导入方法依赖的package包/类
/**
     * Configure AuthenticationManager.
     *
     * NOTE:
     * Due to a known limitation with JavaConfig:
     * <a href="https://jira.spring.io/browse/SPR-13779">
     *     https://jira.spring.io/browse/SPR-13779</a>
     *
     * We cannot use the following to expose a {@link UserDetailsManager}
     * <pre>
     *     http.authorizeRequests()
     * </pre>
     *
     * In order to expose {@link UserDetailsManager} as a bean, we must create  @Bean
     *
     * @see {@link super.userDetailsService()}
     * @see {@link com.packtpub.springsecurity.service.DefaultCalendarService}
     *
     * @param auth       AuthenticationManagerBuilder
     * @throws Exception Authentication exception
     */
    @Override
    public void configure(final AuthenticationManagerBuilder auth) throws Exception {
        auth
                .authenticationProvider(calendarUserAuthenticationProvider)
//            .userDetailsService(userDetailsService)
//            .passwordEncoder(passwordEncoder)
        ;
    }
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:30,代码来源:SecurityConfig.java


注:本文中的org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder.authenticationProvider方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。