0

The LogMeIn API for GoToWebinar says to use this code to refresh an Access Token after it expire:

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}"

Tried recreating it in ColdFusion like this:

<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>

The error we are getting is "error":"invalid_grant".

Before I delve further, is the ColdFusion translation correct (assuming the refresh_token and Authorization encoded keys are correct)?

bigwhipple
  • 13
  • 1
  • I have it running with two `cfhttpparam`s but this does not need to be the problem.`` LogMeIn (I use GoToWebinar) returns `{ "error":"invalid_grant","error_description","The provided authorization grant is invalid"}` in case the token is expired. – Bernhard Döbler Mar 05 '19 at 10:13
  • Did you try to do `ToBase64("")` in your `...abc123...` value? Like [here](https://stackoverflow.com/questions/24933746/getting-basic-authentication-to-work-with-coldfusion) – rrk Mar 05 '19 at 13:29
  • 2
    Possible duplicate of [Getting Basic Authentication to work with ColdFusion](https://stackoverflow.com/questions/24933746/getting-basic-authentication-to-work-with-coldfusion) – rrk Mar 05 '19 at 13:29

0 Answers0