99designs / http-signatures-guzzlehttp

Guzzle 6 support for 99designs http-signatures library
MIT License
12 stars 10 forks source link

Question of header autorization #13

Open Paul75 opened 7 years ago

Paul75 commented 7 years ago

Bonjour,

Je dois appelé un lien avec en header une authorisation de ce fiormat :

Prenons la clé 5e1f9b461d284caf5dc0106c144e8e18 et le secret test_secret. Considérons que l'appel est réalisé à l'heure exacte de 15h33 le 21/04/2016 :

  1. Encoder "date:" et la date et heure au format UTC (les espaces doivent être remplacé par des "+" et non des "%20") : url encoded date:Thu%2C+21+Apr+2016+13%3A32%3A18+UTC

  2. Signer le résultat avec l'algorithme sha1 et du secret ci-dessus puis l'encoder en base 64 : signature: yX9hblzfU9coVzwr4Fbdyj+UQKw=

  3. Encoder la signature : url encoded signature: yX9hblzfU9coVzwr4Fbdyj%2BUQKw%3D

  4. Appeler le service avec le Header Authorization construit de la façon suivante : Authorization: Signature keyId="5e1f9b461d284caf5dc0106c144e8e18",algorithm="hmac-sha1",signature="yX9hblzfU9coVzwr4Fbdyj%2BUQKw%3D"

Es-ce possible avec ce module ?

Merci

joho commented 7 years ago

I just ran this through google translate, came out with

Hello,

I have to call a link with header an authorization of this fiormat:

Take the key 5e1f9b461d284caf5dc0106c144e8e18 and the secret test_secret. Consider that the call is made at the exact time of 15:33 on the 21/04/2016:

Encode "date:" and date and time in UTC format (spaces must be replaced by "+" and not "% 20"): Url encoded date: Thu% 2C + 21 + Apr + 2016 + 13% 3A32% 3A18 + UTC

Sign the result with the algorithm sha1 and the above secret and then encode it in base 64: Signature: yX9hblzfU9coVzwr4Fbdyj + UQKw =

Encode the signature: Url encoded signature: yX9hblzfU9coVzwr4Fbdyj% 2BUQKw% 3D

Call the service with the Header Authorization built in the following way: Authorization: Signature keyId = "5e1f9b461d284caf5dc0106c144e8e18", algorithm = "hmac-sha1", signature = "yX9hblzfU9coVzwr4Fbdyj% 2BUQKw% 3D"

Is this possible with this module?

Thank you