Re: Any library with OAuth support?

2014-01-29 Thread ilya-stromberg
On Wednesday, 22 January 2014 at 11:58:17 UTC, Rikki Cattermole 
wrote:
On Wednesday, 22 January 2014 at 11:14:22 UTC, ilya-stromberg 
wrote:

Do you know any library with OAuth support?


Not currently.
But I can add it to my todo list for Cmsed[0].

[0] https://github.com/rikkimax/Cmsed


Yes, it will be great.


Any library with OAuth support?

2014-01-22 Thread ilya-stromberg

Do you know any library with OAuth support?


Re: Any library with OAuth support?

2014-01-22 Thread Rikki Cattermole
On Wednesday, 22 January 2014 at 11:14:22 UTC, ilya-stromberg 
wrote:

Do you know any library with OAuth support?


Not currently.
But I can add it to my todo list for Cmsed[0].

[0] https://github.com/rikkimax/Cmsed


Re: Any library with OAuth support?

2014-01-22 Thread Adam D. Ruppe
On Wednesday, 22 January 2014 at 11:14:22 UTC, ilya-stromberg 
wrote:

Do you know any library with OAuth support?


I did one extremely biased toward what I needed to do:

https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/oauth.d

also requires cgi.d and curl.d from my same repo. I believe this 
also uses the free library mhash so you'll need that installed on 
your system too.



The basic way it works is you put the params into an struct. I 
already filled in twitter and some others.


Then to get a token, you can call authorizeStepOne and later, 
authorizeStepTwo. Then use curlOauth with your tokens to do 
requests. At the bottom, there's also some signature checking 
things for doing an OAuth server.



But since it is pretty well tied into my cgi.d and is written 
just for what I needed, it might be a pain to use...


Re: Any library with OAuth support?

2014-01-22 Thread ilya-stromberg
On Wednesday, 22 January 2014 at 14:54:00 UTC, Adam D. Ruppe 
wrote:
On Wednesday, 22 January 2014 at 11:14:22 UTC, ilya-stromberg 
wrote:

Do you know any library with OAuth support?


I did one extremely biased toward what I needed to do:


Do you have OAuth server implementation?


Re: Any library with OAuth support?

2014-01-22 Thread Adam D. Ruppe
On Wednesday, 22 January 2014 at 15:29:26 UTC, ilya-stromberg 
wrote:

Do you have OAuth server implementation?


Sort of:

https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff/blob/master/oauth.d#L448

I've never really used it, so it is probably buggy, but I'm 
pretty sure it covers the bases.


Again, it uses my cgi.d, but only a few pieces: get current 
complete url, POST array, and authorization header, so probably 
not too hard to rip that out.


The four functions are:

isOAuthRequest /// true iff authorization is OAuth

getApiKeyFromRequest // gets the user-provided api key (use to 
find the shared secret for the app in your database)


getTokenFromRequest // gets the user-provided user token (again, 
get the shared secret, this time for the user)


isSignatureValid // tests the provided signature against the 
other params