Просмотр исходного кода

Merge pull request #15913 from overleaf/bg-group-sso-fix-signature-error

fix the error message for an invalid saml signature

GitOrigin-RevId: 2987f84f6ff2bea168887ff3e6ad621fb257aeed
Brian Gough 2 лет назад
Родитель
Сommit
011609b345

+ 8 - 6
package-lock.json

@@ -14387,9 +14387,9 @@
       }
     },
     "node_modules/@xmldom/xmldom": {
-      "version": "0.7.9",
-      "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.9.tgz",
-      "integrity": "sha512-yceMpm/xd4W2a85iqZyO09gTnHvXF6pyiWjD2jcOJs7hRoZtNNOO1eJlhHj1ixA+xip2hOyGn+LgcvLCMo5zXA==",
+      "version": "0.7.13",
+      "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.13.tgz",
+      "integrity": "sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g==",
       "engines": {
         "node": ">=10.0.0"
       }
@@ -43530,6 +43530,7 @@
         "@overleaf/redis-wrapper": "*",
         "@overleaf/settings": "*",
         "@slack/webhook": "^7.0.1",
+        "@xmldom/xmldom": "^0.7.13",
         "accepts": "^1.3.7",
         "archiver": "^5.3.0",
         "async": "3.2.2",
@@ -52203,6 +52204,7 @@
         "@uppy/react": "^1.11.0",
         "@uppy/utils": "^4.0.7",
         "@uppy/xhr-upload": "^1.6.8",
+        "@xmldom/xmldom": "^0.7.13",
         "abort-controller": "^3.0.0",
         "accepts": "^1.3.7",
         "ace-builds": "overleaf/ace-builds#v1.4.12-69aace50e6796d42116f8f96e19d2468d8a88af9",
@@ -57589,9 +57591,9 @@
       "requires": {}
     },
     "@xmldom/xmldom": {
-      "version": "0.7.9",
-      "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.9.tgz",
-      "integrity": "sha512-yceMpm/xd4W2a85iqZyO09gTnHvXF6pyiWjD2jcOJs7hRoZtNNOO1eJlhHj1ixA+xip2hOyGn+LgcvLCMo5zXA=="
+      "version": "0.7.13",
+      "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.13.tgz",
+      "integrity": "sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g=="
     },
     "@xtuc/ieee754": {
       "version": "1.2.0",

+ 7 - 0
services/web/app/src/Features/Errors/Errors.js

@@ -120,6 +120,12 @@ class SAMLInvalidSignatureError extends SAMLAuthenticationError {
   }
 }
 
+class SAMLMissingSignatureError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_missing_signature_error'
+  }
+}
+
 class SAMLInvalidResponseError extends SAMLAuthenticationError {}
 
 class SAMLLoginFailureError extends SAMLAuthenticationError {
@@ -261,6 +267,7 @@ module.exports = {
   SAMLGroupSSOLoginIdentityNotFoundError,
   SAMLGroupSSODisabledError,
   SAMLInvalidSignatureError,
+  SAMLMissingSignatureError,
   SAMLInvalidResponseError,
   SAMLLoginFailureError,
   SLInV2Error,

+ 1 - 0
services/web/frontend/extracted-translations.json

@@ -1012,6 +1012,7 @@
   "saml_login_failure": "",
   "saml_login_identity_mismatch_error": "",
   "saml_login_identity_not_found_error": "",
+  "saml_missing_signature_error": "",
   "save": "",
   "save_or_cancel-cancel": "",
   "save_or_cancel-or": "",

+ 2 - 1
services/web/locales/en.json

@@ -1530,11 +1530,12 @@
   "saml_auth_error": "Sorry, your identity provider responded with an error.  Please contact your administrator for more information.",
   "saml_create_admin_instructions": "Choose an email address for the first __appName__ admin account. This should correspond to an account in the SAML system. You will then be asked to log in with this account.",
   "saml_identity_exists_error": "Sorry, the identity returned by your identity provider is already linked with a different Overleaf account.  Please contact your administrator for more information.",
-  "saml_invalid_signature_error": "Sorry, the response from your identity provider was signed with an unexpected certificate.  Please contact your administrator for more information.",
+  "saml_invalid_signature_error": "Sorry, the information received from your identity provider has an invalid signature.  Please contact your administrator for more information.",
   "saml_login_disabled_error": "Sorry, single sign-on login has been disabled for __email__.  Please contact your administrator for more information.",
   "saml_login_failure": "Sorry, there was a problem logging you in.  Please contact your administrator for more information.",
   "saml_login_identity_mismatch_error": "Sorry, you are trying to log in to Overleaf as __email__ but the identity returned by your identity provider is not the correct one for this Overleaf account.",
   "saml_login_identity_not_found_error": "Sorry, we were not able to find an Overleaf account set up for single sign-on with this identity provider.",
+  "saml_missing_signature_error": "Sorry, the information received from your identity provider is not signed (both response and assertion signatures are required).  Please contact your administrator for more information.",
   "save": "Save",
   "save_20_percent_by_paying_annually": "Save 20% by paying annually",
   "save_30_percent_or_more": "save 30% or more",

+ 1 - 0
services/web/package.json

@@ -78,6 +78,7 @@
     "@overleaf/redis-wrapper": "*",
     "@overleaf/settings": "*",
     "@slack/webhook": "^7.0.1",
+    "@xmldom/xmldom": "^0.7.13",
     "accepts": "^1.3.7",
     "archiver": "^5.3.0",
     "async": "3.2.2",