/
Contact usSee pricingStart building

    About B2B Saas Authentication

    Introduction
    Stytch B2B Basics
    Integration Approaches
      Full-stack overview
      Frontend (pre-built UI)
      Frontend (headless)
      Backend
    Next.js
      Routing
      Authentication
      Sessions
    Migrations
      Overview
      Reconciling data models
      Migrating user data
      Additional migration considerations
      Zero-downtime deployment
      Defining external IDs for members
      Exporting from Stytch
    Custom Domains
      Overview

    Authentication

    Single Sign On
    • Resources

      • Overview
        External SSO Connections
    • Integration Guides

      • Start here
        Backend integration guide
        Headless integration guide
        Pre-built UI integration guide
    OAuth
    • Resources

      • Overview
        Authentication flows
        Identity providers
        Google One Tap
        Provider setup
    • Integration Guides

      • Start here
        Backend integration
        Headless frontend integration
        Pre-built UI frontend integration
    Connected AppsBeta
      Setting up Connected Apps
      About Remote MCP Servers
    • Resources

      • Integrate with AI agents
        Integrate with a remote MCP server
    Sessions
    • Resources

      • Overview
        JWTs vs Session Tokens
        How to use Stytch JWTs
        Custom Claims
    • Integration Guides

      • Start here
        Backend integration
        Frontend integration
    Email OTP
      Overview
    Magic Links
    • Resources

      • Overview
        Email Security Scanner Protections
    • Integration Guides

      • Start here
        Backend integration
        Headless frontend integration
        Pre-built UI frontend integration
    Multi-Factor Authentication
    • Resources

      • Overview
    • Integration Guides

      • Start here
        Backend integration
        Headless frontend integration
        Pre-built UI frontend integration
    Passwords
      Overview
      Strength policies
    UI components
      Overview
      Implement the Discovery flow
      Implement the Organization flow
    DFP Protected Auth
      Overview
      Setting up DFP Protected Auth
      Handling challenges
    M2M Authentication
      Authenticate an M2M Client
      Rotate client secrets
      Import M2M Clients from Auth0

    Authorization & Provisioning

    RBAC
    • Resources

      • Overview
        Stytch Resources & Roles
        Role assignment
    • Integration Guides

      • Start here
        Backend integration
        Headless frontend integration
    SCIM
    • Resources

      • Overview
        Supported actions
    • Integration Guides

      • Using Okta
        Using Microsoft Entra
    Organizations
      Managing org settings
      JIT Provisioning

    Testing

    E2E testing
    Sandbox values
Get support on SlackVisit our developer forum

Contact us

B2B Saas Authentication

/

Guides

/

Authentication

/

Magic Links

/

Integration Guides

/

Start here

Getting Started with Email Magic Links

Before integrating Email Magic Links into your application with Stytch, there are a few basic configuration steps in the Stytch Dashboard:

Add or update Redirect URLs

In the Redirect URLs section of the Stytch Dashboard make any updates needed to your default Redirect URLs.

By default, all new projects have redirect URLs set to http://localhost:3000/authenticate for the Test environment in the Dashboard. If you want to use a different port, update the dashboard to specify new default Redirect URLs for:

  • Sign-up and Login Redirect URL (for organization-specific login)
  • Discovery Redirect URL (for discovery authentication)

2
(Optional) Create an Organization

You can get started with the Discovery sign-up or login flow without this step, so feel free to skip to Step 3!

If you want to start with an example of logging into an existing Organization, you can do so by creating an Organization through the Stytch dashboard or CreateOrganization API.

If you will be testing using a corporate email, you can allow Just In Time (JIT) Provisioning to the Organization via email domain by including your domain in the email_allowed_domains array and setting email_jit_provisioning to RESTRICTED.

{
	"organization_id": "organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931",
    ...
    "email_allowed_domains": ["stytch.com"],
    "email_jit_provisioning": "RESTRICTED"
}

JIT Provisioning by email domain is restricted for common, free email providers (e.g. google.com) so if you don’t have a corporate email, you can alternatively create a Member in your new Organization with the email you will use to login.

You can create a Member in the dashboard by navigating to the Organization and clicking “Create new member” or by calling the CreateMember API.

3
Start integrating

Follow one of the below guides to get an end-to-end Email Magic Links flow up and running.

  • Backend integration guide
  • Headless frontend integration guide
  • Pre-built UI frontend integration guide

If you’re not sure what integration approach you want to take long-term, that’s fine!

If you want to get up and running with as little code as possible, check out the pre-built UI integration guides. If you want to get a sense for how much fine-grained control you can have with Stytch, choose between the backend and headless frontend integration guides depending on where in the stack you feel most comfortable.

Add or update Redirect URLs

2.

(Optional) Create an Organization

3.

Start integrating