Difference between revisions of "The signature generation"
(One intermediate revision by one other user not shown) | |||
Line 16: | Line 16: | ||
{{#seo: | {{#seo: | ||
− | |title= | + | |title=The signature generation |
|title_mode=append | |title_mode=append | ||
|keywords=these,are,your,keywords | |keywords=these,are,your,keywords | ||
Line 26: | Line 26: | ||
==Introduction == <!--T:1--> | ==Introduction == <!--T:1--> | ||
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 /> | 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 | + | For technical reasons and for the moment, the authentication parameters must 'always be transmitted via the HTTP GET method |
==Example == <!--T:2--> | ==Example == <!--T:2--> | ||
Line 33: | Line 33: | ||
<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"] = "DH 4=674j_G "; // Mot de passe non chiffré | $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 | ||
Line 65: | Line 65: | ||
==Conclusion == <!--T:4--> | ==Conclusion == <!--T:4--> | ||
− | 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 /> | + | Once the signature is generated, it is necessary to pass it as a parameter (In addition to all the other parameters ) to the API call.<br /> |
Following the previous example, parameters to pass would have therefore been :<br /> | Following the previous example, parameters to pass would have therefore been :<br /> | ||
* login = "mail@example.cOM " | * login = "mail@example.cOM " |
Latest revision as of 05:28, 6 November 2022
en:The signature generation
he:הדור חתימה
ru:Создание подписи
ja:署名の生成
ar:توليد التوقيع
zh:签名生成
ro:Generația semnături
pl:Generowanie podpisu
de:Die Signatur-generation
nl:De handtekening generatie
it:La generazione della firma
pt:A geração de assinatura
es:La generación de una firma
fr:Génération de la signature
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 and for the moment, the authentication parameters must '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 ) to 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 ?
Enable comment auto-refresher