@Import(value={CustomWebSecurityConfigurer.class,CustomAuthorizationServerConfigurer.class})
public class AuthorizationAutoConfiguration
extends Object
| 构造器和说明 |
|---|
AuthorizationAutoConfiguration() |
| 限定符和类型 | 方法和说明 |
|---|---|
org.springframework.security.web.access.AccessDeniedHandler |
accessDeniedHandler()
配置访问拒绝处理器 用于处理权限不足的请求
|
org.springframework.security.oauth2.provider.token.AccessTokenConverter |
accessTokenConverter()
配置访问令牌转换器 用于将token字符串转换成OAuth2AccessToken对象
|
org.springframework.security.web.AuthenticationEntryPoint |
authenticationEntryPoint()
配置认证入口点 用于处理未认证的请求
|
AuthorizationInfoHandle |
authorizationInfoHandle()
配置授权信息处理器 用于处理不同授权类型的用户信息获取
|
org.springframework.security.oauth2.provider.error.WebResponseExceptionTranslator |
customWebResponseExceptionTranslator()
配置自定义的认证异常转换器 用于处理OAuth2认证过程中的异常
|
org.springframework.security.authentication.dao.DaoAuthenticationProvider |
daoAuthenticationProvider(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder,
org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
配置用户名密码认证提供者 用于处理用户名密码认证
|
OAuth2ClientConfigurer |
oAuth2ClientConfigurer(DataSource dataSource)
配置OAuth2客户端配置器 默认使用JDBC从数据库获取客户端信息
|
org.springframework.security.crypto.password.PasswordEncoder |
passwordEncoder()
配置密码编码器 用于处理密码的加密和验证
|
PreValidatorHolder |
preValidatorHolder(org.springframework.beans.factory.ObjectProvider<PreValidator> preValidatorProvider)
配置预检查持有器 用于管理各种预检查验证器
|
SmsCodeAuthenticationProvider |
smsCodeAuthenticationProvider(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
配置手机验证码认证提供者 用于处理手机验证码认证
|
TokenGrantBuilder |
tokenGrantBuilder(org.springframework.security.authentication.AuthenticationManager authenticationManager,
PreValidatorHolder preValidatorHolder)
配置授权类型构建器 默认处理OAuth2规范的5种授权类型 支持自定义添加其他授权类型
|
TokenServicesBuilder |
tokenServicesBuilder(org.springframework.security.core.userdetails.UserDetailsService userDetailsService,
AuthorizationInfoHandle authorizationInfoHandle,
org.springframework.security.oauth2.provider.token.TokenStore tokenStore)
配置令牌服务构建器 用于构建令牌服务
|
org.springframework.security.oauth2.provider.token.TokenStore |
tokenStore()
配置令牌存储 默认使用内存存储,可自定义实现
|
@Bean @ConditionalOnMissingBean public org.springframework.security.oauth2.provider.token.TokenStore tokenStore()
@Bean @ConditionalOnMissingBean public org.springframework.security.oauth2.provider.token.AccessTokenConverter accessTokenConverter()
@Bean @ConditionalOnMissingBean public org.springframework.security.oauth2.provider.error.WebResponseExceptionTranslator customWebResponseExceptionTranslator()
@Bean @ConditionalOnMissingBean public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder()
@Bean @ConditionalOnMissingBean public org.springframework.security.web.AuthenticationEntryPoint authenticationEntryPoint()
@Bean @ConditionalOnMissingBean public org.springframework.security.web.access.AccessDeniedHandler accessDeniedHandler()
@Bean @ConditionalOnMissingBean public OAuth2ClientConfigurer oAuth2ClientConfigurer(DataSource dataSource)
dataSource - 数据源@Bean public PreValidatorHolder preValidatorHolder(org.springframework.beans.factory.ObjectProvider<PreValidator> preValidatorProvider)
preValidatorProvider - 预检查验证器提供者@Bean @ConditionalOnMissingBean public TokenGrantBuilder tokenGrantBuilder(org.springframework.security.authentication.AuthenticationManager authenticationManager, PreValidatorHolder preValidatorHolder)
authenticationManager - 认证管理器preValidatorHolder - 预检查持有器@Bean
@ConditionalOnMissingBean
public org.springframework.security.authentication.dao.DaoAuthenticationProvider daoAuthenticationProvider(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder,
org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
passwordEncoder - 密码编码器userDetailsService - 用户详情服务@Bean public SmsCodeAuthenticationProvider smsCodeAuthenticationProvider(org.springframework.security.core.userdetails.UserDetailsService userDetailsService)
userDetailsService - 用户详情服务@Bean @ConditionalOnMissingBean public AuthorizationInfoHandle authorizationInfoHandle()
@Bean @ConditionalOnMissingBean public TokenServicesBuilder tokenServicesBuilder(org.springframework.security.core.userdetails.UserDetailsService userDetailsService, AuthorizationInfoHandle authorizationInfoHandle, org.springframework.security.oauth2.provider.token.TokenStore tokenStore)
userDetailsService - 用户详情服务authorizationInfoHandle - 授权信息处理器tokenStore - 令牌存储Copyright © 2025. All rights reserved.