Difference between revisions of "The signature generation"
⧼vector-jumptonavigation⧽
⧼vector-jumptosearch⧽
| Line 1: | Line 1: | ||
| − | |||
<br /> | <br /> | ||
This article has been created by an automatic translation software. You can view the article source [[:fr:Génération de la signature|here]].<br /><span data-translate="fr"></span> | This article has been created by an automatic translation software. You can view the article source [[:fr:Génération de la signature|here]].<br /><span data-translate="fr"></span> | ||
| + | |||
<!-- Début de l'article. Placez votre texte ci-après et n'hésitez pas à personnaliser les chapitres selon votre besoin --> | <!-- Début de l'article. Placez votre texte ci-après et n'hésitez pas à personnaliser les chapitres selon votre besoin --> | ||
| Line 8: | Line 8: | ||
| − | ==== <!--T:1--> | + | ==Introduction == <!--T:1--> |
| − | ''''''.<br /> | + | During a call to the API, as described in the WIKI of authentication, a signature is required. It is generated '''based on all of the parameters provided during the call '''.<br /> |
| − | '''' | + | For technical reasons, the authentication settings must ''for the mOM ent '' always be transmitted via the HTTP GET method |
| − | ==== <!--T:2--> | + | ==Example == <!--T:2--> |
<!--T:3--> | <!--T:3--> | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
// Définition des paramètres | // Définition des paramètres | ||
| − | $data["login"] = "mail@example. | + | $data["login"] = "mail@example.cOM "; |
| − | $data["password"] = "4= | + | $data["password"] = "DH 4=674j_G "; // Mot de passe non chiffré |
// D"autres paramètres peuvent êtres ajoutés en fonction de l"appel à l"API | // D"autres paramètres peuvent êtres ajoutés en fonction de l"appel à l"API | ||
// $data["autre_parametre"] = "valeur"; | // $data["autre_parametre"] = "valeur"; | ||
| Line 43: | Line 43: | ||
// Encodage en base64, puis encodage en URL selon RFC 3986 | // Encodage en base64, puis encodage en URL selon RFC 3986 | ||
| − | $= rawurlencode(base64_encode($hash)); | + | $signature = rawurlencode(base64_encode($hash)); |
| − | // ==> $contient alors la finale | + | // ==> $signature contient alors la signature finale |
</syntaxhighlight> | </syntaxhighlight> | ||
| − | ==== <!--T:4--> | + | ==Conclusion == <!--T:4--> |
| − | () <br /> | + | Once the signature is generated, it is necessary to pass it as a parameter (In addition to all the other parameters ) the API call.<br /> |
| − | :<br /> | + | Following the previous example, parameters to pass would have therefore been :<br /> |
| − | * = "mail@example. | + | * login = "mail@example.cOM " |
| − | * = "4= | + | * password = "DH 4=674j_G " |
| − | * = $ | + | * signature = $signature |
<!--T:5--> | <!--T:5--> | ||
<!-- Fin de l'article --> | <!-- Fin de l'article --> | ||
<br /><br /> | <br /><br /> | ||
| − | ? <vote /> | + | This article seemed you to be useful ? <vote /> |
<!-- Placez ici la catégorie à laquelle se rapporte votre article. Ex: [[Category:Help]] --> | <!-- Placez ici la catégorie à laquelle se rapporte votre article. Ex: [[Category:Help]] --> | ||
[[Category:API]] | [[Category:API]] | ||
| Line 64: | Line 64: | ||
<!--T:6--> | <!--T:6--> | ||
<!-- Gestion SEO. Indiquez les informations manquantes --> | <!-- Gestion SEO. Indiquez les informations manquantes --> | ||
| − | |||
| − | |||
<comments /> | <comments /> | ||
Revision as of 08:08, 24 September 2015
This article has been created by an automatic translation software. You can view the article source here.
Introduction
During a call to the API, as described in the WIKI of authentication, a signature is required. It is generated based on all of the parameters provided during the call .
For technical reasons, the authentication settings must for the mOM ent always be transmitted via the HTTP GET method
Example
// Définition des paramètres
$data["login"] = "mail@example.cOM ";
$data["password"] = "DH 4=674j_G "; // Mot de passe non chiffré
// D"autres paramètres peuvent êtres ajoutés en fonction de l"appel à l"API
// $data["autre_parametre"] = "valeur";
// $data["autre_parametre_2"] = "valeur_2";
// $data["..."] = "...";
// Triage des paramètres dans l'ordre croissant
ksort($data);
// Encodage des paramètres
$query = http_build_query($data);
// Encodage des signes plus
$query = str_replace("+", "%20", $query);
// Transformation de la chaîne de caractères en minuscule
$query = strtolower($query);
// Clé publique d'Ikoula (cf. lien ci-dessus)
$public_key="MIIBIjAN...";
// Hashage des paramètres
$hash = hash_hmac("SHA1", $query, $public_key, true);
// Encodage en base64, puis encodage en URL selon RFC 3986
$signature = rawurlencode(base64_encode($hash));
// ==> $signature contient alors la signature finale
Conclusion
Once the signature is generated, it is necessary to pass it as a parameter (In addition to all the other parameters ) the API call.
Following the previous example, parameters to pass would have therefore been :
- login = "mail@example.cOM "
- password = "DH 4=674j_G "
- signature = $signature
This article seemed you to be useful ?
0
Enable comment auto-refresher