PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → Authentification AmazonS3
Authentification AmazonS3
Débuté par Damien BLOND, 19 avr. 2014 15:23 - 1 réponse
Membre enregistré
36 messages
Popularité : +1 (1 vote)
Posté le 19 avril 2014 - 15:23
Bonjour, je m'attaque à l'api de AmazonS3 et je galère.

Je ne comprends pas comment créer la signature en webdev!

la doc:

Suppose your AWS Access Key ID is "44CF9590006BF252F707" and your AWS Secret Access Key is "OtxrzxIsfpFjA7SwPzILwy8Bw21TLhquhboDYROV". Then you could compute the signature as follows:

import base64
import hmac
import sha
h = hmac.new("OtxrzxIsfpFjA7SwPzILwy8Bw21TLhquhboDYROV",
"PUT\nc8fdb181845a4ca6b8fec737b3581d76\ntext/html\nThu, 17 Nov 2005 18:49:58 GMT\nx-amz-magic:abracadabra\nx-amz-meta-author:foo@bar.com\n/quotes/nelson",
sha)
base64.encodestring(h.digest()).strip()
The resulting signature would be "jZNOcbfWmD/A/f3hSvVzXZjM2HU=", and, you would add the Authorization header to your request to come up with the following result:

PUT /quotes/nelson HTTP/1.0
Authorization: AWS 44CF9590006BF252F707:jZNOcbfWmD/A/f3hSvVzXZjM2HU=
Content-Md5: c8fdb181845a4ca6b8fec737b3581d76
Content-Type: text/html
Date: Thu, 17 Nov 2005 18:49:58 GMT
X-Amz-Meta-Author: foo@bar.com
X-Amz-Magic: abracadabra


Je suis un peu perdu, à vrai dire je ne sais pas vraiment comment m'y prendre!

Si une âme charitable pouvait au moiens m'indiquer vaguement comment générer la signature ça m'aiderai beaucoup!

Merci d'avance
Membre enregistré
36 messages
Popularité : +1 (1 vote)
Posté le 21 avril 2014 - 11:00
bon alors j'avance un peu à temps perdu là dessus...

mais ma signature est toujours invalide.

Si qqun à déjà réussi à utiliser l'authentification REST sur S3...

J'utilise pour le moment httpajouteparametre et j'envois ensuite mon formulaire. comment puis-je tracer l'en-tête de la requête envoyée par la fonction httpenvoieformulaire ?

Merci d'avance