Melody AuthMelody Auth
  • Auth Server Setup
  • Admin Panel Setup
  • Email Provider Setup
  • SMS Provider Setup
  • External Identity Providers

    • Social Sign-In Provider Setup
    • OIDC SSO Setup
    • SAML SSO Setup
  • Main Features

    • Authentication
    • JWT & JWKS
    • Multi-Factor Authentication
    • Role-Based Access Control
    • Policies
    • Organizations
  • Additional Features

    • User Attributes
    • App Banners
    • Organization Groups
    • Impersonation
    • Log Management
  • Customization

    • Auth Server Configuration
    • Branding
    • Localization
  • Frontend SDKs

    • React SDK
    • Angular SDK
    • Vue SDK
    • Web SDK
  • Backend APIs

    • S2S API Setup
    • S2S API Swagger
    • Embedded Auth API Setup
    • Embedded Auth API Swagger
  • Deployment Pipelines
  • Rotate JWT Secret
  • English
  • zh-CN
  • Auth Server Setup
  • Admin Panel Setup
  • Email Provider Setup
  • SMS Provider Setup
  • External Identity Providers

    • Social Sign-In Provider Setup
    • OIDC SSO Setup
    • SAML SSO Setup
  • Main Features

    • Authentication
    • JWT & JWKS
    • Multi-Factor Authentication
    • Role-Based Access Control
    • Policies
    • Organizations
  • Additional Features

    • User Attributes
    • App Banners
    • Organization Groups
    • Impersonation
    • Log Management
  • Customization

    • Auth Server Configuration
    • Branding
    • Localization
  • Frontend SDKs

    • React SDK
    • Angular SDK
    • Vue SDK
    • Web SDK
  • Backend APIs

    • S2S API Setup
    • S2S API Swagger
    • Embedded Auth API Setup
    • Embedded Auth API Swagger
  • Deployment Pipelines
  • Rotate JWT Secret
  • English
  • zh-CN
  • SAML SSO Setup

SAML SSO Setup

SAML SSO is currently supported only in the Node.js environment of Melody Auth.

1. Generate SAML SP certificate and key

npm run node:saml:secret:generate

2. Enable SAML SSO in wrangler.toml

Ensure that SAML SSO as a Service Provider (SP) is enabled in your server/wrangler.toml configuration file:

ENABLE_SAML_SSO_AS_SP=true

3. Register a SAML Identity Provider (IdP) via Admin Panel

  • Go to admin panel
  • Click "Manage SAML"
  • Click "Create" button
  • Define a unique name for the IDP, and fill in necessary information
  • Click "Save" button

4. Trigger Login via SAML SSO in the Frontend

Use the loginRedirect function provided by your Melody Auth frontend SDK (e.g., @melody-auth/react) to initiate the login process:

  const {
    loginRedirect
  } = useAuth()

  loginRedirect({
    locale: locale || undefined, org: 'default',
    policy: 'saml_sso_[idp_name]' # Replace [idp_name] with the name of the IDP you created in admin panel
  })
Last Updated: 6/10/25, 11:58 PM
Contributors: Baozier