From a12699133d012735f458ffece4805e841991ee71 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 30 Oct 2023 15:33:41 +0000 Subject: [PATCH] Merge pull request #15420 from overleaf/bg-group-sso-handle-errors handle errors in group sso login GitOrigin-RevId: dcfba6bc4f7aec8aa9d27945b297154594368d92 --- .../web/app/src/Features/Errors/Errors.js | 42 +++++++++++++++++++ services/web/locales/en.json | 6 +++ 2 files changed, 48 insertions(+) diff --git a/services/web/app/src/Features/Errors/Errors.js b/services/web/app/src/Features/Errors/Errors.js index 6cddb97f21..731fe456ea 100644 --- a/services/web/app/src/Features/Errors/Errors.js +++ b/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, diff --git a/services/web/locales/en.json b/services/web/locales/en.json index b9449f9800..1b9bf4768b 100644 --- a/services/web/locales/en.json +++ b/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",