---
title: "Passport.js to WorkOS migration guide"
description: "Passport.js is an authentication middleware for Node.js. While suitable for addressing initial authentication needs, scaling with enterprise features like SSO and SCIM becomes unsustainably complex. This guide details 8 steps to transition from Passport.js to WorkOS."
url: https://workos.com/blog/passport-js-to-workos-migration-guide
published: "Oct 25, 2023"
---

# Passport.js to WorkOS migration guide

### **Scaling Constraints**

Passport.js is organized around the concept of "strategies," which are modules or functions responsible for handling different authentication methods like local authentication, as well as OAuth and OpenID Connect (OIDC) that are used to support SSO. Typically, Passport.js will function as a viable solution for the first few connections. However, as the demand for enterprise support grows, manually provisioning SSO connections with the customer’s identity providers (IdPs) becomes unsustainable. A common next step is to find a replacement solution with an intuitive UI and a seamless IT admin onboarding flow to off-load the SSO maintenance completely.

*"With our in-house solution built on Passport.js, we had to spend 2-4 hours provisioning each SSO connection for enterprise customers. I had no interest in our team becoming SSO/SCIM experts and wanted to find a solution that would allow us to focus on building core products.”*
- Jarel Fryer, Engineering Manager, Chromatic

### **Significant Lift to Implement User Provisioning**

Implementing SCIM (System for Cross-Domain Identity Management), which is critical for user provisioning and deprovisioning, in Passport.js demands considerable effort. This includes crafting route handlers and middleware functions essential for user operations like creation, retrieval, updating, and deletion. To achieve SCIM compliance, strict adherence to IETF (Internet Engineering Task Force) standards is also necessary, including aspects like error response handling, pagination, attribute mapping, and managing complex data structures.

## **Alternative: Migrate to WorkOS in 8 steps**

This migration guide outlines a clear, technical path for transitioning from Passport.js to WorkOS. It aims to empower organizations to efficiently manage their SSO connections, simplify user provisioning/deprovisioning, and focus on core product development. An imaginary “SuperApp” will be used as an example.

### **Preparation**

1. Integrate WorkOS SSO
2. Backfill SSO configuration into WorkOS

### **Migration**

3. Backfill WorkOS Resource IDs into SuperApp:
   - After WorkOS has bulk-created connections, two fields from each connection will need to be persisted in SuperApp:
   - WorkOS can provide a CSV containing these values upon request

Existing SSO Flow

![](https://cdn.prod.website-files.com/621f84dc15b5ed16dc85a18a/671fad83845b076d0e12c52c_671fad4dcc1bee95feb0ae18_sso-initiate-and-redirect.webp)

4. Re-route new SSO customers

![](https://cdn.prod.website-files.com/621f84dc15b5ed16dc85a18a/671fad83845b076d0e12c52f_671fad6c3f6305880b6e6de3_sso-get-auth-url.webp)

5. Forward SAML Responses to WorkOS

![](https://cdn.prod.website-files.com/621f84dc15b5ed16dc85a18a/67102bdec53e3dfe6948b8d3_6682fbb69952a47b6d327e51_migration-step-5-6682fb8ad3200.webp)

6. Set up IdP-Initiated SSO with WorkOS
7. Set up IdP-Initiated SSO for legacy `passport-saml` connections

### **Cleanup**

8. Remove `passport-saml`

## Conclusion

As organizations grow, the constraints of Passport.js, especially regarding SSO and SCIM, become increasingly evident. These areas demand substantial maintenance and bespoke development for enterprise-grade support. For improved scalability and resource optimization, consider transitioning to WorkOS for streamlined SSO and SCIM integrations as well as user-friendly IT admin onboarding. Contact [support@workos.com](mailto:support@workos.com) for a seamless, zero-downtime migration.
