-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Implement SAML (Single Sign-On) Support
What?
We need to develop SAML 2.0 (Single Sign-On) support within the Nexus Framework, allowing it to act as a SAML Service Provider (SP).
Currently, Nexus supports OAuth 2.0, OIDC, API Keys, Basic Auth, and custom static credentials. Adding SAML support will enable Nexus to seamlessly integrate with enterprise Identity Providers (IdPs) that rely on XML-based assertions for authentication.
Why?
- Enterprise Adoption: Many large organizations and enterprises still rely heavily on SAML for Single Sign-On (SSO) across their applications. To drive adoption in these environments, Nexus must support SAML natively.
- Unified Identity Management: The core value proposition of Nexus is providing a single, cohesive layer to manage all types of identity and credentials. Lacking SAML means an incomplete solution for enterprise identity.
- Frictionless Integration: By acting as a SAML SP, Nexus will handle the complexity of generating
AuthnRequestsand validating cryptographic XML assertions, allowing developers to integrate enterprise SSO without writing bespoke, complex SAML logic.
Sample Approach (The "How")
- Data Model Extension: Update the Nexus Broker's data models to support a new
samlvalue in theAuthTypeenums. Extend theprovider_profilestable to store SAML-specific metadata, such as the IdP's SSO URL, Entity ID, and public X.509 certificates used for validating signatures. - SAML Library Integration: Introduce a robust, production-ready Go SAML library (e.g.,
github.com/crewjam/saml) into thenexus-brokerservice to handle XML parsing, signature generation, and validation. - Login Handler Implementation (
/saml/login): Analogous to the OAuth consent flow, build a handler that generates a SAMLAuthnRequestand redirects the user's browser to the enterprise IdP for authentication. - Assertion Consumer Service (ACS) Handler (
/saml/acs): Develop an endpoint to receive the HTTPPOSTcontaining the SAML Response from the IdP. This handler must rigorously validate the XML signature, check assertion conditions (e.g.,NotOnOrAfter), extract user identity and attributes, and finalize the creation of a NexusConnection. - State & Security Management: Ensure SAML
RelayStateis securely generated, signed, and validated (similar to OIDCstate) to prevent CSRF and binding attacks.
Where to Begin
- Research SAML 2.0: Familiarize yourself with the SAML 2.0 Web Browser SSO Profile, specifically the roles of the Identity Provider (IdP) and Service Provider (SP), and the structure of
AuthnRequestandResponseXML documents. - Evaluate Libraries: Review and select an appropriate Go SAML library (like
crewjam/saml) that meets security and maintainability standards. - Extend the Data Model: Begin by updating
nexus-broker/internal/models/constants.goto includesamland craft a database migration to add necessary columns toprovider_profiles. - Build a Proof of Concept: Create a basic SP implementation within
nexus-brokerthat can successfully generate anAuthnRequestand validate a test assertion from a mock IdP (like a local Keycloak instance or a developer Okta tenant). - Integrate into Nexus Flows: Wire the successful SAML authentication into the existing Nexus
Connectioncreation lifecycle, ensuring it issues and encrypts tokens consistently with OAuth/OIDC flows.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request