From e3de6853c74af76b2027549ae3921b5068b35bc4 Mon Sep 17 00:00:00 2001 From: MathieuSevignyLavallee <89943988+MathieuSevignyLavallee@users.noreply.github.com> Date: Sun, 22 Sep 2024 10:41:02 -0400 Subject: [PATCH] studentRoleClaim --- .env.auth | 1 + server/config/auth.js | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.env.auth b/.env.auth index f86d774..18c9a63 100644 --- a/.env.auth +++ b/.env.auth @@ -14,6 +14,7 @@ OAUTH_CLIENT_SECRET=your_oauth_client_secret OAUTH_CALLBACK_URL=https://localhost:3000/auth/provider/callback OAUTH_ADD_SCOPE=scopes OAUTH_ROLE_TEACHER_VALUE=teacher-claim-value +OAUTH_ROLE_STUDENT_VALUE=student-claim-value # Configuration OIDC OIDC_CLIENT_ID=your_oidc_client_id diff --git a/server/config/auth.js b/server/config/auth.js index 167512e..c1effd2 100644 --- a/server/config/auth.js +++ b/server/config/auth.js @@ -1,15 +1,15 @@ require('dotenv').config({ path: './.env.auth' }); module.exports = { - // Activer ou désactiver les types d'authentifications + // Enable or disable the types of authentications simpleLoginActive: process.env.SIMPLE_LOGIN_ACTIVE === 'true', - oauthActive: process.env.OAUTH_ACTIVE === 'true', - oidcActive: process.env.OIDC_ACTIVE === 'true', + oauthActive: process.env.OAUTH_ACTIVE === 'false', + oidcActive: process.env.OIDC_ACTIVE === 'false', - // Configuration Simple Login + // Simple Login Configuration sessionSecret: process.env.SESSION_SECRET || 'default_session_secret', - // Configuration OAuth + // OAuth Configuration oauth: { authorizationURL: process.env.OAUTH_AUTHORIZATION_URL || '', tokenURL: process.env.OAUTH_TOKEN_URL || '', @@ -18,9 +18,10 @@ module.exports = { callbackURL: process.env.OAUTH_CALLBACK_URL || '', scope: process.env.OAUTH_ADD_SCOPE || '', teacherRoleClaim: process.env.OAUTH_ROLE_TEACHER_VALUE || '', + studentRoleClaim: process.env.OAUTH_ROLE_STUDENT_VALUE || '', // Added based on env file }, - // Configuration OIDC + // OIDC Configuration oidc: { clientID: process.env.OIDC_CLIENT_ID || '', clientSecret: process.env.OIDC_CLIENT_SECRET || '',