![]() ![]() I've seen this general idea before in other solutions, so it should be doable, assuming you know what the encoding is. You need to do a "encoding" of the first five values in the header to get the sixth one. If so, then I think that is nice first step to try. The question is "Can BE plugin generate that custom header?" If was a BE_AuthSign(oauth_token, oauth_consumer_key) function, could the plugin generate that header for all future requests? This maybe the standard, but I don't know. It is calculated based on information in the tokens and information in the request. That header is different for each request. So once you have the tokens, you just need to be able to sign each request, by adding an authorization header to each request. Ideally the whole process could be handled by the plugin, but this might serve as a useful first step. You can use quickbooks oAuth playground to generate tokens that work for 180 days. There is a way to get all the tokens you need without doing a bunch of callbacks. Reply to this email directly or view it on GitHub #69 (comment).īut I think this is likely do-able. It sound like you might have that already in place. My biggest concern was signing the oAuth requests. ( update I can't find that page to get the access keys anymore :-) ) At some point this does have to get solved from within FileMaker. I have tested these with Node.js and PHP and they work just fine. They have a test page that lets you login into your Quickbooks Account with your app key etc and get back the tokens. You can get those through the Quickbooks Developer Portal. I haven't messed with getting the tokens yet. See how you go with the first steps around the Request token, and if this works, then I'll look into the url scheme stuff a bit more. So there needs to be a way for the plugin to set itself up with a url scheme, and have it capture all of the url paramters, and then call FileMaker with those. I think you may still come across a redirect issue, like I found in the QuickBooks API : basically they have their own method of redirecting to your app, and there is no way to make it match the FileMaker url scheme of a single "param" and multiple $ variables. I've just had a look at Quickbooks, it doesn't look nice :)īut it does seem like something close to what we have in the plugin. The one we were looking at was MYOB which has a much simpler non-oauth method of getting tokens. Reply to this email directly or view it on GitHub #69. Is there oAuth 2 support with the HTTP functions? Can we sign requests with oAuth2 I see some code in the repo for oAuth but I don't see any documentation for it. Otherwise, let me know I'm keen to see if there are other more general ways we can extend the plugin. It's just at the moment, I'm yet to find a real life API I can test this with. So if that works for the workflow you have, then I'll gladly make it a fully fledged function. To clear out the OAuth information and return to normal programming callīE_OAuth_RequestAccessToken ( "" "" "" ) ![]() Note: I haven't tested them but other HTTP calls may also work (including setting the proxy and custom headers). ![]() Once you have these (possibly saved from an earlier session) then call the function again asīE_OAuth_RequestAccessToken ( access_token_uri consumer_key consumer_secret request_key request_secret )Īfter which you can call BE_GetURL as normal (although there's no point supplying a username and password). The basic process is :īE_OAuth_RequestAccessToken ( request_token_uri consumer_key consumer_secret ) So what's the API you're trying to work with, and what method does it use? The function is still there in the current build, it's called BE_OAuth_RequestAccessToken. But it does seem to require a method for capturing a url scheme that is different enough from what the FileMaker native one would allow. The second I've wanted to use it on was QuickBooks, but their OAuth works by having an browser open the Quickbooks login, which passes a url back to FileMaker and then you do a HTTP POST to confirm everything and get a token for access. ![]() But then when we worked on Xero we found it didn't match the reference much at all, and so we did a separate implementation, and the original OAuth function is still there, but doesn't show in the function list. When the original function was built, it was built to work with the OAuth reference docs, and in theory it does. We started on including OAuth to build in support for Xero. ![]()
0 Comments
Leave a Reply. |