【发布时间】:2025-11-23 17:20:06
【问题描述】:
我添加了一个 JDBC 令牌存储并添加了来自 https://github.com/spring-projects/spring-security-oauth/blob/master/spring-security-oauth2/src/test/resources/schema.sql 的 SQL(第一个和最后一个表除外)。然后我取了一个令牌:
$ curl -u xxx:123456 http://localhost:8080/oauth/token -d grant_type=client_credentials -d client_id=xxx -d client_secret=123456 -d scope=write
{"access_token":"0cbd0733-2c37-400b-abd7-5d1507c2204f","token_type":"bearer","expires_in":42498,"scope":"write"}
唯一有时间戳的表是oauth_approvals,但它是空的!
MariaDB [xxxxxx]> select * from oauth_approvals;
Empty set (0.00 sec)
那么 Spring 如何知道令牌何时过期?
我重新启动服务器并验证令牌仍然有效并且是相同的令牌。
【问题讨论】:
标签: spring spring-security spring-security-oauth2