Thread overview
sign oauth request
Sep 25, 2014
szabo bogdan
Sep 25, 2014
H. S. Teoh
Sep 25, 2014
szabo bogdan
Sep 25, 2014
John Chapman
Sep 25, 2014
Adam D. Ruppe
Sep 25, 2014
szabo bogdan
September 25, 2014
Hi,

How I can sign a request for flickrl oauth api?
https://www.flickr.com/services/api/auth.oauth.html#request_token

there is no HMAC-SHA1 algorithm in phobos library... should I implement it from scratch?

Thanks,
Bogdan
September 25, 2014
On Thu, Sep 25, 2014 at 03:57:36PM +0000, szabo bogdan via Digitalmars-d-learn wrote:
> Hi,
> 
> How I can sign a request for flickrl oauth api? https://www.flickr.com/services/api/auth.oauth.html#request_token
> 
> there is no HMAC-SHA1 algorithm in phobos library... should I implement it from scratch?
[...]

Implementing cryptographic algorithms on your own is probably not a good idea. Your safest bet is to use one of the many C authentication libraries out there, since D can call C functions directly.


T

-- 
Once the bikeshed is up for painting, the rainbow won't suffice. -- Andrei Alexandrescu
September 25, 2014
which lib do you recommand?


On Thursday, 25 September 2014 at 16:19:41 UTC, H. S. Teoh via Digitalmars-d-learn wrote:
> On Thu, Sep 25, 2014 at 03:57:36PM +0000, szabo bogdan via Digitalmars-d-learn wrote:
>> Hi,
>> 
>> How I can sign a request for flickrl oauth api?
>> https://www.flickr.com/services/api/auth.oauth.html#request_token
>> 
>> there is no HMAC-SHA1 algorithm in phobos library... should I implement it
>> from scratch?
> [...]
>
> Implementing cryptographic algorithms on your own is probably not a good
> idea. Your safest bet is to use one of the many C authentication
> libraries out there, since D can call C functions directly.
>
>
> T

September 25, 2014
> there is no HMAC-SHA1 algorithm in phobos library... should I implement it from scratch?

http://dlang.org/phobos/std_digest_sha.html#SHA1
September 25, 2014
On Thursday, 25 September 2014 at 17:03:43 UTC, John Chapman wrote:
> http://dlang.org/phobos/std_digest_sha.html#SHA1

Not quite the same, the oauth requires hmac.

When I did this in my oauth.d for twitter and stuff, I used the C library "mhash"

check out my code:

https://github.com/adamdruppe/arsd/blob/master/oauth.d#L796

The rest of that lib is kinda sloppy and has a few dependencies from my other modules but feel free to use whatever looks useful to you.

I think mhash is GPL licensed.
September 25, 2014
On Thursday, 25 September 2014 at 17:09:40 UTC, Adam D. Ruppe wrote:
> On Thursday, 25 September 2014 at 17:03:43 UTC, John Chapman wrote:
>> http://dlang.org/phobos/std_digest_sha.html#SHA1
>
> Not quite the same, the oauth requires hmac.
>
> When I did this in my oauth.d for twitter and stuff, I used the C library "mhash"
>
> check out my code:
>
> https://github.com/adamdruppe/arsd/blob/master/oauth.d#L796
>
> The rest of that lib is kinda sloppy and has a few dependencies from my other modules but feel free to use whatever looks useful to you.
>
> I think mhash is GPL licensed.


it works! thanks!