Changes for page DigDash API REST

Last modified by Aurelie Bertrand on 2025/03/25 16:13

From version 7.1
edited by Aurelie Bertrand
on 2024/08/29 11:45
Change comment: There is no comment for this version
To version 9.1
edited by Aurelie Bertrand
on 2024/08/29 12:07
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -60,16 +60,33 @@
60 60  [[image:Réponse_requête_JWT.png||alt="Réponse requête JWT"]]
61 61  1. Copiez le jeton JWT.
62 62  
63 -== Authentification via BasicAuth ==
63 +=== Signature du jeton de sécurité ===
64 64  
65 -1. Entrez votre nom d'utilisateur et mot de passe Digdash.
66 -1. Cliquez sur le bouton **Authorize** puis, une fois l'authentification effectuée, sur **Close**.
67 -➡ Le cadenas est à présent fermé, signifiant que vous êtes autorisé.
65 +Une clé privée utilisée pour signer le JWT est codée en dur par défaut.
68 68  
69 -Vous pouvez alors vous authentifier via la seconde méthode :
67 +Pour des raisons de sécurité, il est recommandé d'utiliser votre propre clé privée via des variables d'environnement :
70 70  
69 +DD_JWT_SECRETKEY: can be set to a custom password to use it when signing JWTs
70 +DD_JWT_SECRETKEY_PATH: can be set to specify the path of an RSA private key to use when signing JWTs
71 +
72 +DD_JWT_SECRETKEY_PATH has priority over DD_JWT_SECRETKEY. If neither are set, a hardcoded secret is used instead and a warning message can be found in the logs saying that this is considered insecure and should be changed.
73 +
74 +The RSA private key can be generated using the following command (requires openssl):
75 +
76 +{{{openssl -genrsa -out /path/to/privatekey.pem 2048
77 +}}}
78 +
79 +
80 +The RSA public key can be optionally be generated from the private key using the following command:
81 +
82 +{{{openssl rsa -in /path/to/privatekey.pem -pubout -out /path/to/publickey.crt}}}
83 +
84 +== Authentification via BearerAuth ==
85 +
86 +== (% style="font-size:14px" %)Une fois le jeton de sécurité généré, vous pouvez vous authentifier avec cette méthode :(%%) ==
87 +
71 71  1. Cliquez sur le bouton **Authorize**.
72 -1. Dans le champ **Value** de bearerAuth  (http, Bearer), collez le jeton.
89 +1. Dans le champ **Value** de bearerAuth  (http, Bearer), collez le jeton JWT.
73 73  1. Cliquez sur **Authorize**.
74 74  
75 75