Forums

Find answers, ask questions, and connect with our
community all around the world.

Home Forum Omnis General Forum OAuth

  • Posted by Paul Mulroney on August 22, 2018 at 1:00 am

    Hi Everyone,
    I’m looking into interfacing our Omnis mobile app with the Xero online accounting system. Xero uses OAuth for authentication.
    Has anyone implemented OAuth in Studio? I tried searching on the list archive, but the search option isn’t there anymore …

    Klaus Schrödl replied 5 years, 5 months ago 2 Members · 3 Replies
  • 3 Replies
  • Klaus Schrödl

    Administrator
    August 22, 2018 at 9:31 am

    Hi Paul,
    the Omnis list is being mirrored on this site:
    https://developer.omnis.net/omnislist
    It’s fully searchable with the widget in the right pane or at the page bottom in the mobile version.
    Klaus

  • Paul Mulroney

    Member
    October 3, 2018 at 4:58 am

    Hi Everyone,
    A quick update:
    We’ve been able to get it working, using a HTTP Worker object, and a command line call to openSSL. There’s an Authorisation header that contains the URL of the request and a number of other fields. This is then signed using RSA-SHA1 and sent as part of the request.
    This is our two lines of code that do the magic:
    Calculate vsScript as con('cmd ',kDq,'/c ',kDq,kDq,isOpenSSLPath,kDq,' dgst -sha1 -sign ',kDq,vsKeyFile,kDq,' ',kDq,vsSrcFile,kDq,' | ',kDq,isOpenSSLPath,kDq,' base64 -A',kDq,kDq)
    Launch program [vsScript] Returns vsSignature (Do not quit Omnis)
    It basically does the following on the command line:
    /path/to/openssl.exe dgst -sha1 -sign "/path/to/key/file" "/path/to/request" | "/path/to/openssl.exe" base64 -A
    I don’t think this is a good long-term solution, because we’d be constantly opening a command window to run the signing/base64 conversion
    I believe that Python has a lib that will allow us to do the same thing, but I have no idea how to call it from within Omnis.
    Has anyone tried to sign something using RSA-SHA1 in Omnis? How do you do it?
    Perhaps while you’re at EurOmnis, someone can figure out a quick and dirty hack for us!!

  • Klaus Schrödl

    Administrator
    October 3, 2018 at 9:26 am

    Hi Paul,
    great to hear, you solved the issue. Thank you for posting the solution!

Log in to reply.