Merge branch 'dev-it1-PFEA2024' into it1/feature/RBAC

This commit is contained in:
fserres 2024-10-01 00:54:46 -04:00
commit 3bb1db7236
4 changed files with 18 additions and 5 deletions

View file

@ -23,7 +23,8 @@ const mockConfig = {
type: "oidc", type: "oidc",
OIDC_CLIENT_ID: "your_oidc_client_id", OIDC_CLIENT_ID: "your_oidc_client_id",
OIDC_CLIENT_SECRET: "your_oidc_client_secret", OIDC_CLIENT_SECRET: "your_oidc_client_secret",
OIDC_ISSUER_URL: "https://your-issuer.com", OIDC_CONFIG_URL: "https://your-issuer.com",
OIDC_ADD_SCOPE: "groups",
OIDC_ROLE_TEACHER_VALUE: "teacher-claim-value", OIDC_ROLE_TEACHER_VALUE: "teacher-claim-value",
OIDC_ROLE_STUDENT_VALUE: "student-claim-value", OIDC_ROLE_STUDENT_VALUE: "student-claim-value",
}, },

View file

@ -35,6 +35,7 @@ class PassportOpenIDConnect {
id: profile.id, id: profile.id,
email: profile.emails[0].value, email: profile.emails[0].value,
name: profile.name.givenName, name: profile.name.givenName,
groups: profile.groups[0].value ?? []
}; };
return done(null, user); return done(null, user);
} catch (error) { } catch (error) {

View file

@ -16,11 +16,22 @@
} }
}, },
{ {
"oidc":{ "oidc_gmatte": {
"type":"oidc" "type": "oidc",
"OIDC_CONFIG_URL": "https://auth.gmatte.xyz/application/o/evaluetonsavoir/.well-known/openid-configuration",
"OIDC_CLIENT_ID": "clientID",
"OIDC_CLIENT_SECRET": "clientSecret",
"OIDC_ADD_SCOPE": "groups",
"OIDC_ROLE_TEACHER_VALUE": "groups_evaluetonsavoir-prof",
"OIDC_ROLE_STUDENT_VALUE": "groups_evaluetonsavoir"
} }
} }
], ],
"simple-login": {
"enabled": true,
"name": "provider3",
"SESSION_SECRET": "your_session_secret"
}
"Module X":{ "Module X":{
} }

View file

@ -94,7 +94,7 @@ class AuthConfig {
]; ];
const requiredOIDCFields = [ const requiredOIDCFields = [
'OIDC_CLIENT_ID', 'OIDC_CLIENT_SECRET', 'OIDC_ISSUER_URL', 'OIDC_ROLE_TEACHER_VALUE', 'OIDC_ROLE_STUDENT_VALUE' 'OIDC_CLIENT_ID', 'OIDC_CLIENT_SECRET', 'OIDC_CONFIG_URL', 'OIDC_ROLE_TEACHER_VALUE', 'OIDC_ROLE_STUDENT_VALUE','OIDC_ADD_SCOPE'
]; ];
const missingFieldsReport = []; const missingFieldsReport = [];
@ -155,7 +155,7 @@ class AuthConfig {
}; };
} else if (providerConfig.type === 'oidc') { } else if (providerConfig.type === 'oidc') {
passportConfig[providerName] = { passportConfig[providerName] = {
type: providerConfig.type type: providerConfig.type,
}; };
} }
}); });