diff --git a/app/meteor-accounts-saml/server/saml_rocketchat.js b/app/meteor-accounts-saml/server/saml_rocketchat.js
index 689365c32fe54..a5a162e82b40b 100644
--- a/app/meteor-accounts-saml/server/saml_rocketchat.js
+++ b/app/meteor-accounts-saml/server/saml_rocketchat.js
@@ -160,6 +160,18 @@ Meteor.methods({
section: name,
i18nLabel: 'SAML_Custom_Authn_Context',
});
+ settings.add(`SAML_Custom_${ name }_authn_context_comparison`, 'exact', {
+ type: 'select',
+ values: [
+ { key: 'better', i18nLabel: 'Better' },
+ { key: 'exact', i18nLabel: 'Exact' },
+ { key: 'maximum', i18nLabel: 'Maximum' },
+ { key: 'minimum', i18nLabel: 'Minimum' },
+ ],
+ group: 'SAML',
+ section: name,
+ i18nLabel: 'SAML_Custom_Authn_Context_Comparison',
+ });
settings.add(`SAML_Custom_${ name }_default_user_role`, 'user', {
type: 'string',
@@ -208,6 +220,7 @@ const getSamlConfigs = function(service) {
issuer: settings.get(`${ service.key }_issuer`),
logoutBehaviour: settings.get(`${ service.key }_logout_behaviour`),
customAuthnContext: settings.get(`${ service.key }_custom_authn_context`),
+ authnContextComparison: settings.get(`${ service.key }_authn_context_comparison`),
defaultUserRole: settings.get(`${ service.key }_default_user_role`),
roleAttributeName: settings.get(`${ service.key }_role_attribute_name`),
secret: {
@@ -261,6 +274,7 @@ const configureSamlService = function(samlConfigs) {
privateCert,
privateKey,
customAuthnContext: samlConfigs.customAuthnContext,
+ authnContextComparison: samlConfigs.authnContextComparison,
defaultUserRole: samlConfigs.defaultUserRole,
roleAttributeName: samlConfigs.roleAttributeName,
};
diff --git a/app/meteor-accounts-saml/server/saml_utils.js b/app/meteor-accounts-saml/server/saml_utils.js
index 37313596a222a..7f8452134be5c 100644
--- a/app/meteor-accounts-saml/server/saml_utils.js
+++ b/app/meteor-accounts-saml/server/saml_utils.js
@@ -96,9 +96,10 @@ SAML.prototype.generateAuthorizeRequest = function(req) {
request += `\n`;
}
+ const authnContextComparison = this.options.authnContextComparison || 'exact';
const authnContext = this.options.customAuthnContext || 'urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport';
request
- += ''
+ += ``
+ `${ authnContext }\n`
+ '';
diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json
index 1aac3218b7fdc..cd2f220aa6bfc 100644
--- a/packages/rocketchat-i18n/i18n/en.i18n.json
+++ b/packages/rocketchat-i18n/i18n/en.i18n.json
@@ -460,6 +460,7 @@
"ban-user": "Ban User",
"ban-user_description": "Permission to ban a user from a channel",
"Beta_feature_Depends_on_Video_Conference_to_be_enabled": "Beta feature. Depends on Video Conference to be enabled.",
+ "Better": "Better",
"Best_first_response_time": "Best first response time",
"Block_User": "Block User",
"Blockchain": "Blockchain",
@@ -1341,6 +1342,7 @@
"every_six_hours": "Once every six hours",
"every_day": "Once every day",
"Everyone_can_access_this_channel": "Everyone can access this channel",
+ "Exact": "Exact",
"Example_s": "Example: %s",
"Exclude_Botnames": "Exclude Bots",
"Exclude_Botnames_Description": "Do not propagate messages from bots whose name matches the regular expression above. If left empty, all messages from bots will be propagated.",
@@ -2068,6 +2070,7 @@
"Max_length_is": "Max length is %s",
"Max_number_incoming_livechats_displayed": "Max number of items displayed in the queue",
"Max_number_incoming_livechats_displayed_description": "(Optional) Max number of items displayed in the incoming Livechats queue.",
+ "Maximum": "Maximum",
"Media": "Media",
"Medium": "Medium",
"Members_List": "Members List",
@@ -2176,6 +2179,7 @@
"meteor_status_try_now_waiting": "Try now",
"meteor_status_try_now_offline": "Connect again",
"Min_length_is": "Min length is %s",
+ "Minimum": "Minimum",
"Minimum_balance": "Minimum balance",
"minutes": "minutes",
"Mobile": "Mobile",
@@ -2660,6 +2664,7 @@
"Same_Style_For_Mentions": "Same style for mentions",
"SAML": "SAML",
"SAML_Custom_Authn_Context": "Custom Authn Context",
+ "SAML_Custom_Authn_Context_Comparison": "Authn Context Comparison",
"SAML_Custom_Cert": "Custom Certificate",
"SAML_Custom_Debug": "Enable Debug",
"SAML_Custom_Entry_point": "Custom Entry Point",