Skip to content

Commit 5256fe9

Browse files
authored
Added a configuration option 'disableRequestedAuthnContext' for… (#1097)
Added a configuration option 'disableRequestedAuthnContext' for passport-saml
2 parents fadc599 + 0af9bfb commit 5256fe9

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

Diff for: config.json.example

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
"idpCert": "change: certificate file path of IdP in PEM format",
9494
"issuer": "change or delete: identity of the service provider (default: serverurl)",
9595
"identifierFormat": "change or delete: name identifier format (default: 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress')",
96+
"disableRequestedAuthnContext": "change or delete: true to allow any authentication method, false restricts to password authentication method (default: false)",
9697
"groupAttribute": "change or delete: attribute name for group list (ex: memberOf)",
9798
"requiredGroups": [ "change or delete: group names that allowed" ],
9899
"externalGroups": [ "change or delete: group names that not allowed" ],

Diff for: lib/config/default.js

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ module.exports = {
141141
idpCert: undefined,
142142
issuer: undefined,
143143
identifierFormat: 'urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress',
144+
disableRequestedAuthnContext: false,
144145
groupAttribute: undefined,
145146
externalGroups: [],
146147
requiredGroups: [],

Diff for: lib/config/environment.js

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ module.exports = {
117117
idpCert: process.env.CMD_SAML_IDPCERT,
118118
issuer: process.env.CMD_SAML_ISSUER,
119119
identifierFormat: process.env.CMD_SAML_IDENTIFIERFORMAT,
120+
disableRequestedAuthnContext: toBooleanConfig(process.env.CMD_SAML_DISABLEREQUESTEDAUTHNCONTEXT),
120121
groupAttribute: process.env.CMD_SAML_GROUPATTRIBUTE,
121122
externalGroups: toArrayConfig(process.env.CMD_SAML_EXTERNALGROUPS, '|', []),
122123
requiredGroups: toArrayConfig(process.env.CMD_SAML_REQUIREDGROUPS, '|', []),

Diff for: lib/config/hackmdEnvironment.js

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ module.exports = {
110110
idpCert: process.env.HMD_SAML_IDPCERT,
111111
issuer: process.env.HMD_SAML_ISSUER,
112112
identifierFormat: process.env.HMD_SAML_IDENTIFIERFORMAT,
113+
disableRequestedAuthnContext: toBooleanConfig(process.env.HMD_SAML_DISABLEREQUESTEDAUTHNCONTEXT),
113114
groupAttribute: process.env.HMD_SAML_GROUPATTRIBUTE,
114115
externalGroups: toArrayConfig(process.env.HMD_SAML_EXTERNALGROUPS, '|', []),
115116
requiredGroups: toArrayConfig(process.env.HMD_SAML_REQUIREDGROUPS, '|', []),

Diff for: lib/web/auth/saml/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ passport.use(new SamlStrategy({
1717
entryPoint: config.saml.idpSsoUrl,
1818
issuer: config.saml.issuer || config.serverURL,
1919
cert: fs.readFileSync(config.saml.idpCert, 'utf-8'),
20-
identifierFormat: config.saml.identifierFormat
20+
identifierFormat: config.saml.identifierFormat,
21+
disableRequestedAuthnContext: config.saml.disableRequestedAuthnContext
2122
}, function (user, done) {
2223
// check authorization if needed
2324
if (config.saml.externalGroups && config.saml.groupAttribute) {

0 commit comments

Comments
 (0)