From 351eb4b0a602d5b27e1a874d01d491edfbdf9e85 Mon Sep 17 00:00:00 2001
From: steel <mael.acier@ensiie.fr>
Date: Sat, 18 Jan 2025 01:48:03 +0100
Subject: [PATCH] doc

---
 oidc.php | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/oidc.php b/oidc.php
index 980cefa..2d5e25f 100644
--- a/oidc.php
+++ b/oidc.php
@@ -70,27 +70,28 @@ if (isset($_GET['code'])) {
   $response = curl_exec($ch);
   $tokens = json_decode($response, true);
 
-  // Note: You'd probably want to use a real JWT library
-  // but this will do in a pinch. This is only safe to do
-  // because the ID token came from the https connection
-  // from Google rather than an untrusted browser redirect
+  // Note : Il est préférable d'utiliser une vraie bibliothèque JWT,
+  // mais cette solution peut faire l'affaire en cas de besoin.
+  // L'opération n'est sûre que parce que le jeton d'identification
+  // provient de la connexion https d'AriseID Connect et non
+  // d'une redirection de navigateur non fiable.
 
-  // Split the JWT string into three parts
+  // Sépare la chaîne JWT en trois parties
   $jwt = explode('.', $tokens['id_token']);
 
-  // Extract the middle part, base64 decode it, then json_decode it
+  // Extrait la partie centrale, la décode en base64, puis la décode en json
   $userinfo = json_decode(base64_decode($jwt[1]), true);
 
   $_SESSION['user_id'] = $userinfo['sub'];
   $_SESSION['email'] = $userinfo['email'];
 
-  // While we're at it, let's store the access token and id token
-  // so we can use them later
+  // Stocke le jeton d'accès et le jeton d'identification
+  // pour pouvoir les utiliser ultérieurement
   $_SESSION['access_token'] = $tokens['access_token'];
   $_SESSION['id_token'] = $tokens['id_token'];
   $_SESSION['userinfo'] = $userinfo;
 
-  header('Location: ' . $baseURL);
+  header("Location: $baseURL");
   die();
 }
 
-- 
GitLab