diff --git a/src/main/resources/templates/clientdetails/test_client.html b/src/main/resources/templates/clientdetails/test_client.html
index b9d6414..91e6687 100644
--- a/src/main/resources/templates/clientdetails/test_client.html
+++ b/src/main/resources/templates/clientdetails/test_client.html
@@ -86,7 +86,8 @@
从 spring-oauth-server获取 'code'
PKCE流程在开始前需要先通过代码生成
code_verifier
与
code_challenge
(如何生成详见工具类
-
PKCEUtils.java);
+
PKCEUtils.java
+ );
生成后在获取'code'时要在已有的参数基础上再增加两个参数:
@@ -199,27 +200,32 @@
此处方便演示, 请点击/oauth2/device_verification并输入上一步获取到的user_code
(若未认证将跳转到登录)
- 提示:此步骤必须在有效时间内完成, user_code的有效时长在上一步中返回的数据expires_in来决定(单位:秒, 默认5分钟)
+ 提示:此步骤必须在有效时间内完成, user_code的有效时长在上一步中返回的数据expires_in来决定(单位:秒,
+ 默认5分钟)
- 在第2步进行的同时, 设备上后台将定时(如每隔5秒)向spring-oauth-server
发起获取token的请求/oauth2/token
+ 在第2步进行的同时,
+ 设备上后台将定时(如每隔5秒)向spring-oauth-server
发起获取token的请求/oauth2/token
(需要使用第1步中获取到 device_code 的值),
直到获取成功(即第2步操作完成授权设备登录)或超时(即设备轮询请求等待的时长超出第1步返回的时间expires_in)
- device_code:
+ device_code:
- 提示:在第2步进行过程中调用第3步获取token API时会响应等待授权的结果(Http状态码 400, error='authorization_pending')
+ 提示:在第2步进行过程中调用第3步获取token API时会响应等待授权的结果(Http状态码 400,
+ error='authorization_pending')
@@ -236,11 +242,87 @@
当注册或添加client端时需要填写一个jwk URL地址(用来获取验签的公钥), 指定认证jwt签名算法(如RS256),
- 设置methods为client_secret_jwt
(对称算法, 使用client_secret为MacKey)或private_key_jwt
(非对称算法)
+ 设置methods为client_secret_jwt
(对称算法,
+ 使用client_secret为MacKey)或private_key_jwt
(非对称算法)
+ 注意: grant_type不能只有jwt-bearer, 无实用意义
- ...
+
+ cURL示例:
+
curl --location 'http://localhost:8080/oauth2/token' \
+ --header 'Content-Type: application/json' \
+ --form 'client_id="dofOx6hjxlWw9qe2bnFvqbiPhuWwGWdn"' \
+ --form 'client_assertion_type="urn:ietf:params:oauth:client-assertion-type:jwt-bearer"' \
+ --form 'scope="openid"' \
+ --form 'grant_type="client_credentials"' \
+ --form 'client_assertion="eyJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJkb2ZPeDZoanhsV3c5..."' \
+ --form 'client_secret="dofOx6hjxlWw9qe2bnFvqbiPhuWwGWdn"'
+ 增加两个请求参数:
+
+
+ client_assertion_type |
+ 固定值: urn:ietf:params:oauth:client-assertion-type:jwt-bearer |
+
+
+ client_assertion |
+
+ 使用提供的 jwk URL中的 private_key进行签名生成的 JWT(如何生成详见: JwtBearerFlowTest.java )
+ |
+
+
+
+
+ 输入client_assertion
值, 点击链接地址即可测试
+
@@ -268,7 +350,8 @@
Test [refresh_token]