Przeglądaj źródła

Merge pull request #22803 from overleaf/jel-sso-error-handling

[web] Better error when for missing user SAML callback data

GitOrigin-RevId: 0f781bc46a8684e183d4a860df00c29d6dc9193e
Jessica Lawshe 1 rok temu
rodzic
commit
bcd61354a8

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

@@ -138,6 +138,24 @@ class SAMLMissingSignatureError extends SAMLAuthenticationError {
   }
   }
 }
 }
 
 
+class SAMLInvalidUserIdentifierError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_authentication_required_error'
+  }
+}
+
+class SAMLInvalidUserAttributeError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_authentication_required_error'
+  }
+}
+
+class SAMLMissingUserIdentifierError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_missing_user_attribute'
+  }
+}
+
 class SAMLInvalidResponseError extends SAMLAuthenticationError {}
 class SAMLInvalidResponseError extends SAMLAuthenticationError {}
 
 
 class SAMLResponseAlreadyProcessedError extends SAMLInvalidResponseError {
 class SAMLResponseAlreadyProcessedError extends SAMLInvalidResponseError {
@@ -305,7 +323,10 @@ module.exports = {
   SAMLGroupSSOLoginIdentityMismatchError,
   SAMLGroupSSOLoginIdentityMismatchError,
   SAMLGroupSSOLoginIdentityNotFoundError,
   SAMLGroupSSOLoginIdentityNotFoundError,
   SAMLGroupSSODisabledError,
   SAMLGroupSSODisabledError,
+  SAMLInvalidUserAttributeError,
+  SAMLInvalidUserIdentifierError,
   SAMLInvalidSignatureError,
   SAMLInvalidSignatureError,
+  SAMLMissingUserIdentifierError,
   SAMLMissingSignatureError,
   SAMLMissingSignatureError,
   SAMLInvalidResponseError,
   SAMLInvalidResponseError,
   SAMLLoginFailureError,
   SAMLLoginFailureError,

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

@@ -1821,6 +1821,7 @@
   "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_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_metadata": "Overleaf SAML Metadata",
   "saml_metadata": "Overleaf SAML Metadata",
   "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.",
   "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.",
+  "saml_missing_user_attribute": "There was a problem with your Single Sign-on authentication. Your organization did not provide the required information to complete authentication. Please contact your administrator for more information.",
   "saml_response": "SAML Response",
   "saml_response": "SAML Response",
   "save": "Save",
   "save": "Save",
   "save_20_percent": "save 20%",
   "save_20_percent": "save 20%",