用于GoToWebinar的LogMeIn API表示在过期后使用此代码刷新访问令牌:
curl -X POST "https://api.getgo.com/oauth/v2/token" \
-H "Authorization: Basic {Base64 Encoded consumerKey and consumerSecret}" \
-H "Accept:application/json" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token&refresh_token={refresh_token}"
尝试像这样在ColdFusion中重新创建它:
<cfhttp url="https://api.getgo.com/oauth/v2/token" method="post" result="httpResp" timeout="60">
<cfhttpparam type="header" name="Accept" value="application/json" />
<cfhttpparam type="header" name="Authorization" value="Basic ...abc123..." />
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
<cfhttpparam type="body" encoded="false" value="grant_type=refresh_token&refresh_token=#refreshToken#" />
</cfhttp>
我们得到的错误是“错误”:“ invalid_grant”。
在我进一步研究之前,ColdFusion转换是否正确(假设refresh_token和授权编码的密钥正确)?