In my attempts to get the necessary code so I can generate my refresh token, I ran this URL:
And my received code contains a trailing hash tag, which throws an (expected) error when I try to execute:
<cfhttp url="https://accounts.google.com/o/oauth2/token" method="post">
<cfhttpparam name="code" value="4/UXF5F5TlIuFsXrav-DvIrebMR8NST9WK-EPmThmx7l0#" type="formfield"> <!-- Sample code value -->
<cfhttpparam name="client_id" value="--myclientid--" type="formfield">
<cfhttpparam name="client_secret" value="[client secret]" type="formfield">
<cfhttpparam name="redirect_uri" value="--mywebsite--">
<cfhttpparam name="grant_type" value="authorization_code" type="formfield">
</cfhttp>
ColdFusion was looking at the following text:
formfield
The CFML compiler was processing:
- An expression that began on line 2, column 86.
The expression might be missing an ending #, for example, #expr instead of #expr#. - The tag attribute value, on line 2, column 34.
- A cfhttpparam tag beginning on line 2, column 10.
I tried adding a second hashtag to make it literal but I receive { "error" : "invalid_grant", "error_description" : "Invalid code." }
response.
Am I missing something painfully obvious here? The tutorial I was following is at http://www.brandiandjohn.com/post.cfm/oauth-2-google-and-cfml-without-cfoauth