Just noticed this thread (I’m researching Quickbooks integration)…
[quote=347647:@Nicholas Henson]The same string is produced everytime with xojo and php. However, xojo seems to add something that look like chr(13) when printed to text area, php does not but produces same string.
Now i assume that this encoded string never changes so i just hard coded it into xojo from the php encoded string. While the php is able to get an access token with its encoded string, Xojo is not able to get an access token with the php encoded string and comes back with an invalid_grant error. This is another portion that i’m confused why it works for one and not the other since the encoded string never changes.[/quote]
Xojo EncodeBase64
by default will add a line break every 76 characters (Base64 standard).
SMTP (email) requires this, but HTTP tokens can be longer than 76 characters and the line breaks will fail.
There is an HTTP Authorization exception to send a single Base64 string with no breaks.
The EncodeBase64
function has an optional line length, use 0 for no line breaks.
Try this in your code EncodeBase64(qbo.ClientID+":"+qbo.ClientSecret,0)
That should still work if you need to change tokens.