Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Development»Integrating Drupal with Salesforce SSO via SAML and Dynamic User Sync

    Integrating Drupal with Salesforce SSO via SAML and Dynamic User Sync

    June 14, 2025

    Single Sign-On (SSO) is a crucial part of modern web applications, enabling users to authenticate once and access multiple systems securely. If your organization uses Salesforce as an Identity Provider (IdP) and Drupal as a Service Provider (SP), you can establish a secure SSO connection using the SAML protocol.

    In this blog, we’ll walk through how to integrate Drupal with Salesforce for SSO using the SAML Authentication module. We’ll also explore how to dynamically sync user data—like first name, last name, company, and roles—from Salesforce into Drupal during login.

    Prerequisites

    Before starting, ensure you have the following:

    • A working Drupal 9 or 10 site.
    • Access to the Salesforce admin console.
    • The SAML Authentication module installed in Drupal.
    • SSL enabled on your Drupal site (SAML requires HTTPS).

    Step 1: Install the SAML Authentication Module in Drupal

    You can install the module via Composer:

    composer require drupal/saml_auth

    Then enable it using Drush or through the Drupal admin interface:

    drush en saml_auth

    Dependencies (like simplesamlphp) may need to be managed manually or via the simplesamlphp_auth module if you prefer a different approach.

    Step 2: Configure Salesforce as an Identity Provider (IdP)

    • Log in to Salesforce, and go to: Setup → Apps → App Manager → New Connected App
    • Fill in the basic details, then under Web App Settings:
      • Enable SAML.
      • Entity ID: Use your Drupal site’s SP Entity ID (e.g., https://example.com/saml/metadata)
      • ACS URL: https://example.com/saml/acs
      • Subject Type: Usually Email or Username.
      • Name ID Format: urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress
    • Add custom attributes:
      • FirstName
      • LastName
      • Company
      • Roles
    • Download the IdP metadata or note:
      • IdP SSO URL
      • IdP Entity ID
      • X.509 certificate

    Step 3: Configure the SAML Authentication Module in Drupal

    Navigate to: Admin → Configuration → People → SAML Authentication Settings (/admin/config/people/saml)

    Fill in the settings:

    • IdP Entity ID and SSO URL: From Salesforce.
    • X.509 Certificate: Paste the public cert here.
    • SP Entity ID: Can be your site URL or a custom value.
    • ACS URL: Must match what you provided to Salesforce.
    • NameID format: Match Salesforce (usually emailAddress).
    • User match field: Set to mail.

    Step 4: Dynamic User Synchronization

    By default, SAML Authentication handles user login and account creation, but we extended this with custom logic to map additional attributes from Salesforce into the Drupal user profile.

    Salesforce sends additional user information in the SAML assertion, including:

    • First name
    • Last name
    • Company
    • Roles

    We’ve extended the default SAML authentication behavior with a custom hook or event subscriber to:

    • Create new users in Drupal using the email as the unique identifier.
    • Populate additional profile fields like first name, last name, and company.
    • Assign user roles dynamically based on the roles attribute from Salesforce.

    This ensures that user accounts are fully provisioned and kept up-to-date every time a user logs in through SSO.

    Step 5: Test the SSO Flow

    • Log out of your Drupal site.
    • Navigate to /saml/login.
    • You’ll be redirected to Salesforce to authenticate.
    • After login, you’ll be redirected back to Drupal and logged in automatically with synced user details.

    Check that:

    • A new Drupal user is created if it doesn’t exist.
    • First name, last name, and company fields are populated.
    • Roles are assigned correctly.

    If there’s an error, enable debugging logs and inspect the SAML response and assertion for mismatches.

    Conclusion

    Integrating Salesforce with Drupal using the SAML Authentication module enables a seamless and secure SSO experience. This is particularly useful for organizations using Salesforce as a central identity system. With proper configuration, users can enjoy frictionless access to your Drupal site while benefiting from Salesforce’s authentication infrastructure.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous ArticleDiscord Invite Link Hijacking Delivers AsyncRAT and Skuld Stealer Targeting Crypto Wallets
    Next Article Tunnel Run game in 170 lines of pure JS

    Related Posts

    Development

    GPT-5 is Coming: Revolutionizing Software Testing

    July 22, 2025
    Development

    Win the Accessibility Game: Combining AI with Human Judgment

    July 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    BSD Release: DragonFlyBSD 6.4.1

    News & Updates

    CVE-2025-32738 – IO DATA HDL-T Series Authentication Bypass

    Common Vulnerabilities and Exposures (CVEs)

    How global threat actors are weaponizing AI now, according to OpenAI

    News & Updates

    CVE-2025-53839 – DRACOON Branding Service Cross-Site Scripting Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    CVE-2025-49081 – There is an insufficient input validation vulnerab

    June 12, 2025

    CVE ID : CVE-2025-49081

    Published : June 12, 2025, 6:15 p.m. | 3 hours, 46 minutes ago

    Description : There is an insufficient input validation vulnerability in the warehouse
    component of Absolute Secure Access prior to server version 13.55. Attackers
    with system administrator permissions can impair the availability of the Secure
    Access administrative UI by writing invalid data to the warehouse over the
    network. The attack complexity is low, there are no attack requirements,
    privileges required are high, and there is no user interaction required. There
    is no impact on confidentiality or integrity; the impact on availability is
    high.

    Severity: 0.0 | NA

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    How to Use Microsoft Teams Online (Beginner Guide)

    July 16, 2025

    CVE-2025-45611 – Hope-Boot Authentication Bypass

    May 6, 2025

    Wire Room Math: AI + SME = (Less Compensation Paid) X (Headline Risk + Payment Errors)^2

    June 30, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.