Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Twitter OAuth

Has anybody ever tried it with codea? Is it doable?

I feel like it would be an absolute pain to set up.

Tagged:

Comments

  • edited November 2015 Posts: 2,020

    There are a couple of Lua oauth libraries, have you looked at those?

    This one has examples involving Twitter:

    https://github.com/ignacio/LuaOAuth

    Both libraries seem to have the crypto library from LuaNode as a dependency:

    https://github.com/ignacio/LuaNode

    And that library in turn could have dependencies. So it can be quite complex trying to work out what could be made to run in Codea (LuaJit is not allowed on iOS, but Codea does have LuaSocket which lots of these libraries use).

    So yes, it would be complex, but don't be put off. I managed to get an SHA1 library working in Codea without too much hassle.

  • edited November 2015 Posts: 505

    I'm coding a gist/git repl inside Codea right now. Github uses oauth_token's to authenticate users, which is actually pretty easy to work with. Basically its just passing crypted keys through http.request headers.

  • Posts: 2,020

    @se24vad cool! Could you explain a bit more about the process? What kind of encryption is it, is it digest? The person who created the SHA1 library I used also made a Lua digest/MD5 library. That would be great for all kinds of things, if we got a digest authentication library working in Codea.

  • edited November 2015 Posts: 505

    @yojimbo2000 Sorry, I have to disappoint you. I don't use any encryption library on my end. The encryption is handled by the Github API (and I assume twitter handles this similarly). You choose the desired administration level inside your account settings and Github generates a SHA1 outh_token for you. I then use this token in my app for all http.requests to Github (again through their API) - by passing around this token inside the header of each http.request

    PS: I'm still new to http.requests, authentification and all this stuff, but I will share my repl once its done. For now have a look at GitHub API v3 for more information.

Sign In or Register to comment.