本文整理匯總了Java中org.springframework.security.authentication.AuthenticationManager類的典型用法代碼示例。如果您正苦於以下問題:Java AuthenticationManager類的具體用法?Java AuthenticationManager怎麽用?Java AuthenticationManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AuthenticationManager類屬於org.springframework.security.authentication包,在下文中一共展示了AuthenticationManager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AuthServiceImpl
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
@Autowired
public AuthServiceImpl(
AuthenticationManager authenticationManager,
UserDetailsService userDetailsService,
JwtTokenUtil jwtTokenUtil,
UsersRepository usersRepository) {
this.authenticationManager = authenticationManager;
this.userDetailsService = userDetailsService;
this.jwtTokenUtil = jwtTokenUtil;
this.usersRepository = usersRepository;
}
示例2: AuthorizationServerConfiguration
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
public AuthorizationServerConfiguration(@Qualifier("authenticationManagerBean") AuthenticationManager authenticationManager,
TokenStore tokenStore, DataSource dataSource) {
this.authenticationManager = authenticationManager;
this.tokenStore = tokenStore;
this.dataSource = dataSource;
}
示例3: AuthServiceImpl
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
@Autowired
public AuthServiceImpl(
AuthenticationManager authenticationManager,
UserDetailsService userDetailsService,
JwtTokenUtil jwtTokenUtil,
UserRepository userRepository,
RoleRepository roleRepository) {
this.authenticationManager = authenticationManager;
this.userDetailsService = userDetailsService;
this.jwtTokenUtil = jwtTokenUtil;
this.userRepository = userRepository;
this.roleRepository = roleRepository;
}
示例4: OAuth2Configuration
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
public OAuth2Configuration(ResourceLoader resourceLoader, OpenIdProviderProperties properties,
ObjectProvider<JdbcOperations> jdbcOperations, ObjectProvider<AuthenticationManager> authenticationManager,
ObjectProvider<HazelcastInstance> hazelcastInstance) {
this.resourceLoader = resourceLoader;
this.properties = properties;
this.jdbcOperations = jdbcOperations.getObject();
this.authenticationManager = authenticationManager.getObject();
this.hazelcastInstance = hazelcastInstance.getObject();
}
示例5: OAuth2AuthorizationServerConfig
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
public OAuth2AuthorizationServerConfig(AccessTokenConverter accessTokenConverter, ApprovalStore approvalStore, AuthenticationManager authenticationManager, OAuth2ClientService clientService, TokenEnhancer tokenEnhancer, TokenStore tokenStore) {
this.accessTokenConverter = accessTokenConverter;
this.approvalStore = approvalStore;
this.authenticationManager = authenticationManager;
this.clientService = clientService;
this.tokenEnhancer = tokenEnhancer;
this.tokenStore = tokenStore;
}
示例6: PreauthFilter
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
public PreauthFilter(AuthenticationManager authenticationManager, AuditLogger logger) {
super();
this.setAuthenticationManager(authenticationManager);
this.setAuthenticationSuccessHandler((request, response, authentication) -> logger.logEvent(new LoginEvent(Instant.now(), extractUsername(request), true)));
this.setAuthenticationFailureHandler((request, response, exception) -> logger.logEvent(new LoginEvent(Instant.now(), extractUsername(request), false)));
}
示例7: JWTLoginFilter
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
protected JWTLoginFilter(String defaultFilterProcessesUrl,
TokenProvider tokenProvider,
JwtSecurityProperties jwtSecurityProperties,
AuthenticationManager authenticationManager) {
super(new AntPathRequestMatcher(defaultFilterProcessesUrl));
this.tokenProvider = tokenProvider;
this.jwtSecurityProperties = jwtSecurityProperties;
setAuthenticationManager(authenticationManager);
}
示例8: getAuthenticationManager
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
@Bean(name="authenticationManagerBean")
public AuthenticationManager getAuthenticationManager(){
return new AuthenticationManager() {
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
throw new UnsupportedOperationException("No authentication should be done with this AuthenticationManager");
}
};
}
示例9: auth
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
public static Authentication auth(AuthenticationManager authenticationManager, String userName, String password) {
SecurityContext sc = SecurityContextHolder.getContext();
UsernamePasswordAuthenticationToken upToken = new UsernamePasswordAuthenticationToken(userName, password);
Authentication authentication = authenticationManager.authenticate(upToken);
sc.setAuthentication(authentication);
return sc.getAuthentication();
}
示例10: authenticationManagerBean
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
@Override
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
示例11: AuthServerOAuth2Config
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
@Autowired
public AuthServerOAuth2Config(AuthenticationManager authenticationManager, AppConfig appConfig) {
this.authenticationManager = authenticationManager;
this.appConfig = appConfig;
}
示例12: UserJWTController
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
public UserJWTController(TokenProvider tokenProvider, AuthenticationManager authenticationManager) {
this.tokenProvider = tokenProvider;
this.authenticationManager = authenticationManager;
}
示例13: authenticationManagerBean
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
@Bean
@Override
public AuthenticationManager authenticationManagerBean()
throws Exception {
return super.authenticationManagerBean();
}
示例14: authenticationManagerBean
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
@Override
@Bean
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:6,代碼來源:OAuth2AutoConfigurationTests.java
示例15: CustomAuthorizationServer
import org.springframework.security.authentication.AuthenticationManager; //導入依賴的package包/類
protected CustomAuthorizationServer(AuthenticationManager authenticationManager) {
this.authenticationManager = authenticationManager;
}
開發者ID:spring-projects,項目名稱:spring-security-oauth2-boot,代碼行數:4,代碼來源:OAuth2AutoConfigurationTests.java