Difference between revisions of "Authentication and security"

From EN Ikoula wiki
⧼vector-jumptonavigation⧽ ⧼vector-jumptosearch⧽
Tag: merged edit of another user
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<span data-link_translate_fr_title="Authentification et sécurité"  data-link_translate_fr_url="Authentification et sécurité"></span>[[:fr:Authentification et sécurité]][[fr:Authentification et sécurité]]
 +
<span data-link_translate_en_title="Authentication and security"  data-link_translate_en_url="Authentication and security"></span>[[:en:Authentication and security]][[en:Authentication and security]]
 +
<span data-link_translate_es_title="Autenticación y seguridad"  data-link_translate_es_url="Autenticación y seguridad"></span>[[:es:Autenticación y seguridad]][[es:Autenticación y seguridad]]
 +
<span data-link_translate_pt_title="Autenticação e segurança"  data-link_translate_pt_url="Autenticação e segurança"></span>[[:pt:Autenticação e segurança]][[pt:Autenticação e segurança]]
 +
<span data-link_translate_it_title="Autenticazione e protezione"  data-link_translate_it_url="Autenticazione e protezione"></span>[[:it:Autenticazione e protezione]][[it:Autenticazione e protezione]]
 +
<span data-link_translate_nl_title="Verificatie en beveiliging"  data-link_translate_nl_url="Verificatie en beveiliging"></span>[[:nl:Verificatie en beveiliging]][[nl:Verificatie en beveiliging]]
 +
<span data-link_translate_de_title="Authentifizierung und Sicherheit"  data-link_translate_de_url="Authentifizierung und Sicherheit"></span>[[:de:Authentifizierung und Sicherheit]][[de:Authentifizierung und Sicherheit]]
 +
<span data-link_translate_zh_title="身份验证和安全"  data-link_translate_zh_url="身份验证和安全"></span>[[:zh:身份验证和安全]][[zh:身份验证和安全]]
 +
<span data-link_translate_ar_title="الأمان والمصادقة"  data-link_translate_ar_url="الأمان والمصادقة"></span>[[:ar:الأمان والمصادقة]][[ar:الأمان والمصادقة]]
 +
<span data-link_translate_ja_title="認証とセキュリティ"  data-link_translate_ja_url="認証とセキュリティ"></span>[[:ja:認証とセキュリティ]][[ja:認証とセキュリティ]]
 +
<span data-link_translate_pl_title="Uwierzytelniania i zabezpieczeń"  data-link_translate_pl_url="Uwierzytelniania i zabezpieczeń"></span>[[:pl:Uwierzytelniania i zabezpieczeń]][[pl:Uwierzytelniania i zabezpieczeń]]
 +
<span data-link_translate_ru_title="Проверка подлинности и безопасность"  data-link_translate_ru_url="Проверка подлинности и безопасность"></span>[[:ru:Проверка подлинности и безопасность]][[ru:Проверка подлинности и безопасность]]
 +
<span data-link_translate_ro_title="Autentificare și securitate"  data-link_translate_ro_url="Autentificare și securitate"></span>[[:ro:Autentificare și securitate]][[ro:Autentificare și securitate]]
 +
<span data-link_translate_he_title="אבטחה ואימות"  data-link_translate_he_url="אבטחה ואימות"></span>[[:he:אבטחה ואימות]][[he:אבטחה ואימות]]
 
<br />This article has been created by an automatic translation software. You can view the article source [[:fr:Authentification et sécurité|here]].<br /><span data-translate="fr"></span><br />
 
<br />This article has been created by an automatic translation software. You can view the article source [[:fr:Authentification et sécurité|here]].<br /><span data-translate="fr"></span><br />
 +
<span data-link_translate_fr_title="Authentification et sécurité"  data-link_translate_fr_url="Authentification et sécurité"></span>[[:fr:Authentification et sécurité]][[fr:Authentification et sécurité]]
 
<span data-link_translate_he_title="אבטחה ואימות"  data-link_translate_he_url="%D7%90%D7%91%D7%98%D7%97%D7%94+%D7%95%D7%90%D7%99%D7%9E%D7%95%D7%AA"></span>[[:he:אבטחה ואימות]][[he:אבטחה ואימות]]
 
<span data-link_translate_he_title="אבטחה ואימות"  data-link_translate_he_url="%D7%90%D7%91%D7%98%D7%97%D7%94+%D7%95%D7%90%D7%99%D7%9E%D7%95%D7%AA"></span>[[:he:אבטחה ואימות]][[he:אבטחה ואימות]]
 
<span data-link_translate_ro_title="Autentificare și securitate"  data-link_translate_ro_url="Autentificare+%C8%99i+securitate"></span>[[:ro:Autentificare și securitate]][[ro:Autentificare și securitate]]
 
<span data-link_translate_ro_title="Autentificare și securitate"  data-link_translate_ro_url="Autentificare+%C8%99i+securitate"></span>[[:ro:Autentificare și securitate]][[ro:Autentificare și securitate]]
Line 15: Line 30:
 
<!-- 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 -->
  
 
+
{{#seo:
 +
|title=Your page title
 +
|title_mode=append
 +
|keywords=these,are,your,keywords
 +
|description=Authentication and security
 +
|image=Uploaded_file.png
 +
|image_alt=Wiki Logo
 +
}}
  
 
==Introduction==
 
==Introduction==
How to authenticate the API Ikoula and policies of {{Template:Sécurité}} ?
+
How to '''authenticate''' the API Ikoula and policies of {{Template:Sécurité}} ?
  
 
==Explanations==
 
==Explanations==
Pour des raisons évidentes de {{Template:Sécurité}}, l'API Ikoula exige une authentification. Celle-ci est basée sur un identifiant, un mot de passe et une signature :<br />
+
Pour des raisons évidentes de {{Template:Sécurité}}, l'API Ikoula exige une ''authentication''. Celle-ci est basée sur un identifiant, un mot de passe et une signature :<br />
 
* The ID is the email address used to connect your Ikoula account or to the extranet. The name of the parameter to pass is always  <span class="notranslate">'''login'''</span> ;
 
* The ID is the email address used to connect your Ikoula account or to the extranet. The name of the parameter to pass is always  <span class="notranslate">'''login'''</span> ;
 
* The password as it may be, is provided in clear text (parameter  <span class="notranslate">'''password'''</span>), is encrypted via a specific function using a public key provided by Ikoula (parameter  <span class="notranslate">'''crypted_password'''</span>) and Base64_encode ;
 
* The password as it may be, is provided in clear text (parameter  <span class="notranslate">'''password'''</span>), is encrypted via a specific function using a public key provided by Ikoula (parameter  <span class="notranslate">'''crypted_password'''</span>) and Base64_encode ;

Latest revision as of 12:12, 5 March 2020

fr:Authentification et sécurité en:Authentication and security es:Autenticación y seguridad pt:Autenticação e segurança it:Autenticazione e protezione nl:Verificatie en beveiliging de:Authentifizierung und Sicherheit zh:身份验证和安全 ar:الأمان والمصادقة ja:認証とセキュリティ pl:Uwierzytelniania i zabezpieczeń ru:Проверка подлинности и безопасность ro:Autentificare și securitate he:אבטחה ואימות
This article has been created by an automatic translation software. You can view the article source here.

fr:Authentification et sécurité he:אבטחה ואימות ro:Autentificare și securitate ru:Проверка подлинности и безопасность pl:Uwierzytelniania i zabezpieczeń ja:認証とセキュリティ ar:الأمان والمصادقة zh:身份验证和安全 de:Authentifizierung und Sicherheit nl:Verificatie en beveiliging it:Autenticazione e protezione pt:Autenticação e segurança es:Autenticación y seguridad en:Authentication and security

Introduction

How to authenticate the API Ikoula and policies of Security ?

Explanations

Pour des raisons évidentes de Security, l'API Ikoula exige une authentication. Celle-ci est basée sur un identifiant, un mot de passe et une signature :

  • The ID is the email address used to connect your Ikoula account or to the extranet. The name of the parameter to pass is always login ;
  • The password as it may be, is provided in clear text (parameter password), is encrypted via a specific function using a public key provided by Ikoula (parameter crypted_password) and Base64_encode ;
  • The signature is generated based on the parameters supplied when calling the API (see the signature generation process ==> Génération de la signature).


These settings should always be passed in GET to the API !

ATTENTION :
The passage of the password in clear text is provided to facilitate the handling of the API and serves as a debug. For your tests to the API, you can, for example, use a temporary user dedicated to these tests and authenticate you with the password in clear (see the Wiki for the creation of sous-utilisateur: https://support.ikoula.com/index-1-2-2835.html).

The use of encryption of password with the public key Ikoula is essential in any production environment or non-court term.
If the API calls are doomed to be used via a script or a program, we recommend creating a user dedicated to this purpose rather than use your extranet user classic.
You have two options :

  • Contact our support for the creation of an extranet user ;
  • Create a sous-utilisateur directly from the homepage of your extranet account (See the WIKI for the creation of sous-utilisateur: https://support.ikoula.com/index-1-2-2835.html).

Attention à ne pas oublier de lui mettre les droits sur les prestations souhaitées.

Public key encryption of the password is available at the following address
https://api.ikoula.com/downloads/Ikoula.API.RSAKeyPub.pem

Examples

For this example, the login will be "ikoulasupport".
To encrypt the password, here is an example of a function using the public key ikoula :

// Chemin local vers la clef publique téléchargée à http://api.ikoula.com/downloads/Ikoula.API.RSAKeyPub.pem
define('API_PUB_KEY_PATH', dirname(__FILE__) . '/Ikoula.API.RSAKeyPub.pem');
 
// Fonction de cryptage du mot de passe via la clef publique Ikoula
function opensslEncryptPublic($password)
{
        // Vérification de la présence de la clef publique
        if(file_exists(API_PUB_KEY_PATH))
        {
                if(!empty($password))
                {
                        // on récupére la clef public
                        $publicKey = openssl_pkey_get_public('file://'.realpath(API_PUB_KEY_PATH));
 
                        // Si il n'y a pas eu d'erreur lors de la récupération de la clef publique on continue
                        if ($publicKey !== FALSE)      
                        {
                                // Si chiffrement clef publique OK
                                if(openssl_public_encrypt($password, $crypted, $publicKey) === TRUE)   
                                {
                                        // Renvoie du passe crypté
                                        return $crypted;       
                                }
                                else
                                {
                                        return NULL;
                                }
                        }
                        else
                                return NULL;
                }
                else
                        return NULL;
        }
        else
        {
                echo("Erreur la clée public n'est pas présente.\n");
                return NULL;
        }
}
 
// Utilisation de la fonction de cryptage
$password_crypt = opensslEncryptPublic("Mot de passe non crypté");
if($password_crypt != NULL)
        echo "OK Mot de passe crypté: ".$password_crypt;
else
        echo "Erreur lors du cryptage du mot de passe.";

// ==> $password_crypt contient donc le mot de passe crypté

Conclusion

Once the password encrypted and encrypted signature, we can do the API call with parameters (If we follow the above example) :

  • login = ikoulasupport ;
  • crypted_password = base64_encode($password_crypt) ;
  • signature = signature generated (see the signature generation process ==> Génération de la signature).


NB : Don't forget to url_encoder each parameter passed !



This article seem useful to you ?

0

Catégorie:API



You are not allowed to post comments.