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

Merge pull request #15420 from overleaf/bg-group-sso-handle-errors

handle errors in group sso login

GitOrigin-RevId: dcfba6bc4f7aec8aa9d27945b297154594368d92
Brian Gough 2 лет назад
Родитель
Сommit
a12699133d
2 измененных файлов с 48 добавлено и 0 удалено
  1. 42 0
      services/web/app/src/Features/Errors/Errors.js
  2. 6 0
      services/web/locales/en.json

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

@@ -90,6 +90,42 @@ class SAMLEmailAffiliatedWithAnotherInstitutionError extends OError {
   }
 }
 
+class SAMLAuthenticationError extends OError {
+  get i18nKey() {
+    return 'saml_auth_error'
+  }
+}
+
+class SAMLGroupSSOLoginIdentityMismatchError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_login_identity_mismatch_error'
+  }
+}
+
+class SAMLGroupSSOLoginIdentityNotFoundError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_login_identity_not_found_error'
+  }
+}
+
+class SAMLGroupSSODisabledError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_login_disabled_error'
+  }
+}
+
+class SAMLInvalidSignatureError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_invalid_signature_error'
+  }
+}
+
+class SAMLLoginFailureError extends SAMLAuthenticationError {
+  get i18nKey() {
+    return 'saml_login_failure'
+  }
+}
+
 class SAMLSessionDataMissing extends BackwardCompatibleError {
   constructor(arg) {
     super(arg)
@@ -218,6 +254,12 @@ module.exports = {
   SAMLEmailNotAffiliatedError,
   SAMLEmailAffiliatedWithAnotherInstitutionError,
   SAMLSessionDataMissing,
+  SAMLAuthenticationError,
+  SAMLGroupSSOLoginIdentityMismatchError,
+  SAMLGroupSSOLoginIdentityNotFoundError,
+  SAMLGroupSSODisabledError,
+  SAMLInvalidSignatureError,
+  SAMLLoginFailureError,
   SLInV2Error,
   ThirdPartyIdentityExistsError,
   ThirdPartyUserNotFoundError,

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

@@ -1503,7 +1503,13 @@
   "role": "Role",
   "ru": "Russian",
   "saml": "SAML",
+  "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_invalid_signature_error": "Sorry, the response from your identity provider was signed with an unexpected certificate.  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.",
   "save": "Save",
   "save_20_percent_by_paying_annually": "Save 20% by paying annually",
   "save_30_percent_or_more": "save 30% or more",