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

Improve display of generic SAML errors

GitOrigin-RevId: 60096874480c268be52faddd96ebdf870bdf0a64
Simon Gardner 11 месяцев назад
Родитель
Сommit
4cc07da294

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

@@ -223,6 +223,12 @@ class SAMLSessionDataMissing extends BackwardCompatibleError {
 
 class SAMLProviderRequesterError extends SAMLAuthenticationError {}
 
+class SAMLProviderRequesterInvalidNameIDPolicyError extends SAMLProviderRequesterError {
+  get i18nKey() {
+    return 'sso_provider_error_invalid_name'
+  }
+}
+
 class ThirdPartyIdentityExistsError extends BackwardCompatibleError {
   constructor(arg) {
     super(arg)
@@ -358,6 +364,7 @@ module.exports = {
   SAMLMissingUserIdentifierError,
   SAMLMissingSignatureError,
   SAMLProviderRequesterError,
+  SAMLProviderRequesterInvalidNameIDPolicyError,
   SAMLInvalidResponseError,
   SAMLLoginFailureError,
   SAMLEmailNotRecognizedError,

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

@@ -1670,6 +1670,7 @@
   "sso_link_invite_has_been_sent_to_email": "",
   "sso_logs": "",
   "sso_not_active": "",
+  "sso_provider_error_invalid_name": "",
   "sso_reauth_request": "",
   "sso_test_interstitial_info_1": "",
   "sso_test_interstitial_info_2": "",

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

@@ -2160,6 +2160,7 @@
   "sso_logs": "SSO Logs",
   "sso_not_active": "SSO not active",
   "sso_not_linked": "You have not linked your account to __provider__. Please log in to your account another way and link your __provider__ account via your account settings.",
+  "sso_provider_error_invalid_name": "The identity provider returned an InvalidNameIDPolicy error. This happens when the identity provider is unable to provide a user identity in the format requested by this application.",
   "sso_reauth_request": "SSO reauthentication request has been sent to <0>__email__</0>",
   "sso_test_interstitial_info_1": "<0>Before starting this test</0>, please ensure you’ve <1>configured Overleaf as a Service Provider in your IdP</1>, and authorized access to the Overleaf service.",
   "sso_test_interstitial_info_2": "Clicking <0>Test configuration</0> will redirect you to your IdP’s login screen. <1>Read our documentation</1> for full details of what happens during the test. And check our <2>SSO troubleshooting advice</2> if you get stuck.",