diff --git a/app/javascript/dashboard/api/samlSettings.js b/app/javascript/dashboard/api/samlSettings.js new file mode 100644 index 000000000..7c0f5b266 --- /dev/null +++ b/app/javascript/dashboard/api/samlSettings.js @@ -0,0 +1,26 @@ +/* global axios */ +import ApiClient from './ApiClient'; + +class SamlSettingsAPI extends ApiClient { + constructor() { + super('saml_settings', { accountScoped: true }); + } + + get() { + return axios.get(this.url); + } + + create(data) { + return axios.post(this.url, { saml_settings: data }); + } + + update(data) { + return axios.put(this.url, { saml_settings: data }); + } + + delete() { + return axios.delete(this.url); + } +} + +export default new SamlSettingsAPI(); diff --git a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue index 27736c3a2..ab6537031 100644 --- a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue +++ b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue @@ -494,6 +494,12 @@ const menuItems = computed(() => { icon: 'i-lucide-clock-alert', to: accountScopedRoute('sla_list'), }, + { + name: 'Settings Security', + label: t('SIDEBAR.SECURITY'), + icon: 'i-lucide-shield', + to: accountScopedRoute('security_settings_index'), + }, { name: 'Settings Billing', label: t('SIDEBAR.BILLING'), diff --git a/app/javascript/dashboard/featureFlags.js b/app/javascript/dashboard/featureFlags.js index 143094ae5..9d7997648 100644 --- a/app/javascript/dashboard/featureFlags.js +++ b/app/javascript/dashboard/featureFlags.js @@ -40,6 +40,7 @@ export const FEATURE_FLAGS = { CONTACT_CHATWOOT_SUPPORT_TEAM: 'contact_chatwoot_support_team', WHATSAPP_EMBEDDED_SIGNUP: 'whatsapp_embedded_signup', CAPTAIN_V2: 'captain_integration_v2', + SAML: 'saml', }; export const PREMIUM_FEATURES = [ @@ -49,4 +50,5 @@ export const PREMIUM_FEATURES = [ FEATURE_FLAGS.AUDIT_LOGS, FEATURE_FLAGS.HELP_CENTER, FEATURE_FLAGS.CAPTAIN_V2, + FEATURE_FLAGS.SAML, ]; diff --git a/app/javascript/dashboard/helper/featureHelper.js b/app/javascript/dashboard/helper/featureHelper.js index ee61b0656..910a6bed6 100644 --- a/app/javascript/dashboard/helper/featureHelper.js +++ b/app/javascript/dashboard/helper/featureHelper.js @@ -19,6 +19,7 @@ const FEATURE_HELP_URLS = { team_management: 'https://chwt.app/hc/teams', webhook: 'https://chwt.app/hc/webhooks', billing: 'https://chwt.app/pricing', + saml: 'https://chwt.app/hc/saml', }; export function getHelpUrlForFeature(featureName) { diff --git a/app/javascript/dashboard/i18n/locale/en/settings.json b/app/javascript/dashboard/i18n/locale/en/settings.json index c95eada84..b81a47f4e 100644 --- a/app/javascript/dashboard/i18n/locale/en/settings.json +++ b/app/javascript/dashboard/i18n/locale/en/settings.json @@ -358,7 +358,8 @@ "INFO_TEXT": "Let the system automatically mark you offline when you aren't using the app or dashboard.", "INFO_SHORT": "Automatically mark offline when you aren't using the app." }, - "DOCS": "Read docs" + "DOCS": "Read docs", + "SECURITY": "Security" }, "BILLING_SETTINGS": { "TITLE": "Billing", @@ -390,6 +391,77 @@ }, "NO_BILLING_USER": "Your billing account is being configured. Please refresh the page and try again." }, + "SECURITY_SETTINGS": { + "TITLE": "Security", + "DESCRIPTION": "Manage your account security settings.", + "LINK_TEXT": "Learn more about SAML SSO", + "SAML": { + "TITLE": "SAML SSO", + "NOTE": "Configure SAML single sign-on for your account. Users will authenticate through your identity provider instead of using email/password.", + "ACS_URL": { + "LABEL": "ACS URL", + "TOOLTIP": "Assertion Consumer Service URL - Configure this URL in your IdP as the destination for SAML responses" + }, + "SSO_URL": { + "LABEL": "SSO URL", + "HELP": "The URL where SAML authentication requests will be sent", + "PLACEHOLDER": "https://your-idp.com/saml/sso" + }, + "CERTIFICATE": { + "LABEL": "Signing certificate in PEM format", + "HELP": "The public certificate from your identity provider used to verify SAML responses", + "PLACEHOLDER": "-----BEGIN CERTIFICATE-----\nMIIC..." + }, + "FINGERPRINT": { + "LABEL": "Fingerprint", + "TOOLTIP": "SHA-1 fingerprint of the certificate - Use this to verify the certificate in your IdP configuration" + }, + "COPY_SUCCESS": "Copied to clipboard", + "SP_ENTITY_ID": { + "LABEL": "SP Entity ID", + "HELP": "Unique identifier for this application as a service provider (auto-generated).", + "TOOLTIP": "Unique identifier for Chatwoot as the Service Provider - Configure this in your IdP settings" + }, + "IDP_ENTITY_ID": { + "LABEL": "Identity Provider Entity ID", + "HELP": "Unique identifier for your identity provider (usually found in IdP configuration)", + "PLACEHOLDER": "https://your-idp.com/saml" + }, + "UPDATE_BUTTON": "Update SAML Settings", + "API": { + "SUCCESS": "SAML settings updated successfully", + "ERROR": "Failed to update SAML settings", + "ERROR_LOADING": "Failed to load SAML settings", + "DISABLED": "SAML settings disabled successfully" + }, + "VALIDATION": { + "REQUIRED_FIELDS": "SSO URL, Identity Provider Entity ID, and Certificate are required fields", + "SSO_URL_ERROR": "Please enter a valid SSO URL", + "CERTIFICATE_ERROR": "Certificate is required", + "IDP_ENTITY_ID_ERROR": "Identity Provider Entity ID is required" + }, + "ENTERPRISE_PAYWALL": { + "AVAILABLE_ON": "The SAML SSO feature is only available in the Enterprise plans.", + "UPGRADE_PROMPT": "Upgrade to an Enterprise plan to access SAML single sign-on and other advanced security features.", + "ASK_ADMIN": "Please reach out to your administrator for the upgrade." + }, + "PAYWALL": { + "TITLE": "Upgrade to enable SAML SSO", + "AVAILABLE_ON": "The SAML SSO feature is only available in the Enterprise plans.", + "UPGRADE_PROMPT": "Upgrade your plan to get access to SAML single sign-on and other advanced features.", + "UPGRADE_NOW": "Upgrade now", + "CANCEL_ANYTIME": "You can change or cancel your plan anytime" + }, + "ATTRIBUTE_MAPPING": { + "TITLE": "SAML Attribute Setup", + "DESCRIPTION": "The following attribute mappings must be configured in your identity provider" + }, + "INFO_SECTION": { + "TITLE": "Service Provider Information", + "TOOLTIP": "Copy these values and configure them in your Identity Provider to establish the SAML connection" + } + } + }, "CREATE_ACCOUNT": { "NO_ACCOUNT_WARNING": "Uh oh! We could not find any Chatwoot accounts. Please create a new account to continue.", "NEW_ACCOUNT": "New Account", diff --git a/app/javascript/dashboard/routes/dashboard/settings/security/Index.vue b/app/javascript/dashboard/routes/dashboard/settings/security/Index.vue new file mode 100644 index 000000000..0ac35c9e2 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/security/Index.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlAttributeMap.vue b/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlAttributeMap.vue new file mode 100644 index 000000000..442b426df --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlAttributeMap.vue @@ -0,0 +1,50 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlInfoSection.vue b/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlInfoSection.vue new file mode 100644 index 000000000..66820cafa --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlInfoSection.vue @@ -0,0 +1,102 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlPaywall.vue b/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlPaywall.vue new file mode 100644 index 000000000..a08cce9e0 --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlPaywall.vue @@ -0,0 +1,41 @@ + + + diff --git a/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlSettings.vue b/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlSettings.vue new file mode 100644 index 000000000..dca12200b --- /dev/null +++ b/app/javascript/dashboard/routes/dashboard/settings/security/components/SamlSettings.vue @@ -0,0 +1,251 @@ + + +