提供 OAuth2 授权的基础配置属性和工具类,被 auth-server 和 auth-resource 模块共同依赖。

仓库坐标

Maven

<dependency>
    <groupId>com.luamas.thinkbridge</groupId>
    <artifactId>authorization-base-spring-boot-starter</artifactId>
</dependency>

Gradle

implementation("com.luamas.thinkbridge:authorization-base-spring-boot-starter")

配置属性

所有配置前缀为 think.auth:

属性

默认值

说明

think.auth.token-url

/oauth2/token

Token 端点路径

think.auth.authorization-url

/oauth2/authorize

授权端点路径

think.auth.jwk-set-uri

/oauth2/jwks

JWK Set 端点路径

think.auth.issuer-uri

签发者URI

think.auth.client-id

客户端ID

think.auth.client-secret

客户端密钥

think.auth.scope

授权范围

think.auth.redirect-uri

重定向URI

think.auth.grant-type

授权类型

think.auth.username-attribute

sub

用户名属性

自动配置的Bean

Bean

说明

ThinkBridgeAuthProperties

授权配置属性类

ThinkBridgeTokenAuthentication

自定义 Token 认证处理器

ThinkBridgeBearerTokenResolver

自定义 Bearer Token 解析器

此模块通常不需要单独引入,而是通过 auth-server-spring-boot-starter 或 auth-resource-spring-boot-starter 间接依赖。