Copy link to clipboard
Copied
Hi,
using cfoauth at amazon to access selling portal api.
If I hard code my clientid, secretKey etc everything works great I get the access_token. I have a query in the cfc component that gets these but if I use them in the <cfoauth tag the process fails - "invalid_client". I tried this <cfset x = "typed my client id here" />
then in cfoauth clientid = "#x#" and this worked also.
I tried adding toString() to the query result of clientid, that did not help.
Wondering if anyone else has had problems with using query results inside cfoauth?
1 Correct answer
There's no reason that should be true, that I know of. But I'd question instead whether the column var value is indeed exactly equal to the cfset var value.
I'll assume you've already done simple things like outputting the col value, whether cfdump, cfoutput, cflog or their script equivalents. If you might contend "I can't create output on this page", note how I offered also cflog, which wouldn't require seeing theo output on screen.
Even if the values may prove to "look" the same, your nex
...Copy link to clipboard
Copied
There's no reason that should be true, that I know of. But I'd question instead whether the column var value is indeed exactly equal to the cfset var value.
I'll assume you've already done simple things like outputting the col value, whether cfdump, cfoutput, cflog or their script equivalents. If you might contend "I can't create output on this page", note how I offered also cflog, which wouldn't require seeing theo output on screen.
Even if the values may prove to "look" the same, your next step would be to compare the values. There are multiple ways to do that, whether the compare function or the various conditionals like IS, IS EQUAL TO, etc and operators like == and ===. More on those here.
Finally, about the "invalid client" error, do you belive that's coming from cf or from the destination auth server? Have you looked at all the cf logs, to see if any of them have more detail on the error? BTW, if on Windows don't rely on sorting the files by date/time modified in Windows Explorer: I've seen it frequently NOT reflect that a file had more recent modifications than the date/time shown.
Let us know what you find. Maybe others will have better answers or suggestions for you. And if this is business critical and a solution is not found via back and forth here, sometimes there's no substitute for having a shared desktop session together where seeing things may be far more effective. I can offer that on a consulting basis (carehart.org/consulting), but I'll also be happy to proceed here instead.
/Charlie (troubleshooter, carehart. org)
Copy link to clipboard
Copied
Hi Charlie,
I appreciate you taking the time to point me in the right direction.
I feel a bit silly that I did not try what the final solution turned out to be. I was in a hurry to build it out, I was counting on someone having had this themselves.
I took your suggestion of comparing the values and a simple trim() cured my issue. I had copied the credentials from Postman and pasted them into MS SQL in the edit top 200 screen. It must have picked up a CR and when I pulled it out with cfquery it just did not show up until I compared the two.
Thanks again.
Mike
Copy link to clipboard
Copied
Great to hear and glad to have helped. That problem could easily happen to anyone, so don't feel bad. But yes, I spend a lot of my day helping folks identify causes for problems that are often not at all what they expect. 🙂
/Charlie (troubleshooter, carehart. org)

