LiveCode server as OAuth2 client for APIs?
Ralf Bitter
rabit at revigniter.com
Wed Dec 6 12:53:07 EST 2023
Hi Keith,
using revIgniter you can always hard code the opening
form tag, this way you can use any URL as an action
attribute.
However, your message has prompted me to change the
rigFormOpen() function so that you can override the
current URL with the value of an optional action
attribute included in the second parameter.
So, if you like, you can download the modified
version of the form helper at:
https://github.com/revig/revigniter/blob/develop/system/helpers/formHelper.livecodescript
Ralf
On 06.12.2023 11:00, Keith Clarke via use-livecode wrote:
> Hi folks,
> Does anyone have experience of using OAuth2 with LiveCode server, to log into third-party data sources for API access?
>
> I am experimenting with a web based utility app that runs on LiveCode server & RevIgniter and I need to be able to log into a Salesforce.com <http://salesforce.com/> account to pull data into the app via APIs. I’m following the Salesforce Oauth 2.0 Web Server Flow for Web App Integration https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_web_server_flow.htm&type=5 and
>
> I’ve configured the LiveCode app as a connected app in a Salesforce developer instance, to create a consumer id, with which I can request an authorisation code. This requires a POST to a Salesforce endpoint, which, if successful redirects to a page on the Salesforce authorisation server to provide login credentials. This is where I’m stuck...
>
> The LiveCode OAuth2 library seems to be desktop centric (expecting any redirects via the loopback IP address of 127.0.0.1, rather than a URL); the RevIgniter forms library seems to support posts to URLs within the LiveCode app but not third party URLs; and if I create a LiveCode file to ‘post data to URL tSalesforceAuthURL’ from within RevIgniter, I can’t see any option to follow redirects and so, unsurprisingly, the page URL doesn’t change.
>
> Any advice greatly appreciated.
> Best,
> Keith
> _______________________________________________
More information about the use-livecode
mailing list