【发布时间】:2015-10-28 19:42:00
【问题描述】:
我正在尝试更新通过 API Manager 生成的令牌。
生成令牌的curl语句为:
curl -k -d "grant_type=client_credentials" -H "Authorization: Basic TDQ0SktDZm5DcVVDSVBjdGYwVDIyRWwwUGY4YT
o2d19NQm9xYnBFXzRLNHR0Wkc0NXhxd0NMTDRh , Content-Type: application/x-www-form-urlencoded" https://10.108.106.214:8250/token
回复是
"scope":"am_application_scope default","token_type":"bearer","expires_in":1094,"access_token":"6d1d0f8afbd147d24bcd42bbc5361a1"
根据文档,它应该生成一个未生成的重新令牌。我错过了什么?
当我将grant_type 作为refresh_token 传递时。我收到一个无效的授权错误。
curl -X POST -H "Authorization: Basic TDQ0SktDZm5DcVVDSVBjdGYwVDIyRWwwUGY4YTo2d19NQm9xYnBFXzRLNHR0Wkc0NXhxd0NMTDRh" -H "Content-Type: application/x-www-form-urlencoded" -d 'grant_type=refresh_token&refresh_token=6d1d0f8afbd147d24bcd42bbc5361a1' 'https://10.108.106.214:8250/token'
我指的是 URL 中的文档 https://docs.wso2.com/display/AM191/Token+API#TokenAPI-RenewingaccesstokensRenewing
那么我错过了什么?
【问题讨论】: