类 OAuth2ServerConfig

java.lang.Object
xyz.raylab.authorizationserver.configuration.OAuth2ServerConfig

@Configuration(proxyBeanMethods=false) public class OAuth2ServerConfig extends Object
  • 构造器概要

    构造器
    构造器
    说明
    OAuth2ServerConfig(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder, JoseKeyGenerator joseKeyGenerator, DefaultClientProperties defaultClientProperties, SettingsProperties settingsProperties)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationConsentService
    authorizationConsentService(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository)
    如果是授权码的流程,可能客户端申请了多个权限,比如:获取用户信息,修改用户信息,此Service处理的是用户给这个客户端哪些权限,比如只给获取用户信息的权限
    org.springframework.security.web.SecurityFilterChain
    authorizationServerSecurityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
     
    org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings
    配置一些断点的路径,比如:获取token、授权端点 等
    org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
    authorizationService(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository)
    保存授权信息,授权服务器给我们颁发来token,那我们肯定需要保存吧,由这个服务来保存
    org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer<org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext>
     
    org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer<org.springframework.security.oauth2.server.authorization.token.OAuth2TokenClaimsContext>
     
    com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext>
     
    org.springframework.security.oauth2.jwt.JwtDecoder
    jwtDecoder(com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext> jwkSource)
     
    org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository
    registeredClientRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
    创建客户端信息,可以保存在内存和数据库,此处保存在数据库中

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 构造器详细资料

  • 方法详细资料

    • authorizationServerSecurityFilterChain

      @Bean @Order(-2147483648) public org.springframework.security.web.SecurityFilterChain authorizationServerSecurityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      抛出:
      Exception
    • registeredClientRepository

      @Bean public org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate)
      创建客户端信息,可以保存在内存和数据库,此处保存在数据库中
    • authorizationService

      @Bean public org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService authorizationService(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository)
      保存授权信息,授权服务器给我们颁发来token,那我们肯定需要保存吧,由这个服务来保存
    • authorizationConsentService

      @Bean public org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationConsentService authorizationConsentService(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate, org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository)
      如果是授权码的流程,可能客户端申请了多个权限,比如:获取用户信息,修改用户信息,此Service处理的是用户给这个客户端哪些权限,比如只给获取用户信息的权限
    • jwkSource

      @Bean public com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext> jwkSource()
    • jwtDecoder

      @Bean public org.springframework.security.oauth2.jwt.JwtDecoder jwtDecoder(com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext> jwkSource)
    • authorizationServerSettings

      @Bean public org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings authorizationServerSettings()
      配置一些断点的路径,比如:获取token、授权端点 等
    • buildJwtCustomizer

      @Bean public org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer<org.springframework.security.oauth2.server.authorization.token.JwtEncodingContext> buildJwtCustomizer()
    • buildOAuth2TokenClaimsCustomizer

      @Bean public org.springframework.security.oauth2.server.authorization.token.OAuth2TokenCustomizer<org.springframework.security.oauth2.server.authorization.token.OAuth2TokenClaimsContext> buildOAuth2TokenClaimsCustomizer()