我是 Keycloak 身份和用户管理的新手。 我主要是在寻找一种生成离线令牌的方法。
目前我有 授权 URL、访问令牌请求和刷新令牌请求 为了生成离线令牌,我们需要添加额外的参数 scope=offline_access 我不确定为什么在我的情况下它没有生成,因为我已经验证了 jwt.io 的不记名令牌,“typ”不是“离线”。
访问令牌请求是
curl \
-d "client_id=<my-client-id>" -d "client_secret=<client-secret>" \
-d "username=<user>" -d "password=<pass>" \
-d "grant_type=password" \
-d "scope=openid info offline_access" \
https://localhost:8080/auth/realms/demo/protocol/openid-connect/token | jq
Method: POST
URL: https://keycloak.example.com/auth/realms/myrealm/protocol/openid-connect/token
Body type: x-www-form-urlencoded
Form fields:
client_id : <my-client-name>
grant_type : refresh_token
refresh_token: <my-refresh-token>
请推荐