From bcd61354a803c31acae2b7c48550c43ae3da37e1 Mon Sep 17 00:00:00 2001 From: Jessica Lawshe <5312836+lawshe@users.noreply.github.com> Date: Tue, 4 Feb 2025 09:02:05 -0600 Subject: [PATCH] Merge pull request #22803 from overleaf/jel-sso-error-handling [web] Better error when for missing user SAML callback data GitOrigin-RevId: 0f781bc46a8684e183d4a860df00c29d6dc9193e --- .../web/app/src/Features/Errors/Errors.js | 21 +++++++++++++++++++ services/web/locales/en.json | 1 + 2 files changed, 22 insertions(+) diff --git a/services/web/app/src/Features/Errors/Errors.js b/services/web/app/src/Features/Errors/Errors.js index 40076cea6e..7e32da2824 100644 --- a/services/web/app/src/Features/Errors/Errors.js +++ b/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 SAMLResponseAlreadyProcessedError extends SAMLInvalidResponseError { @@ -305,7 +323,10 @@ module.exports = { SAMLGroupSSOLoginIdentityMismatchError, SAMLGroupSSOLoginIdentityNotFoundError, SAMLGroupSSODisabledError, + SAMLInvalidUserAttributeError, + SAMLInvalidUserIdentifierError, SAMLInvalidSignatureError, + SAMLMissingUserIdentifierError, SAMLMissingSignatureError, SAMLInvalidResponseError, SAMLLoginFailureError, diff --git a/services/web/locales/en.json b/services/web/locales/en.json index f60f412029..4bd9e1d817 100644 --- a/services/web/locales/en.json +++ b/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_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_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", "save": "Save", "save_20_percent": "save 20%",