/
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
        Standalone SSO
    • 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
    • Integration Guides

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

      • About Remote MCP Servers
    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

/

M2M Authentication

/

Import M2M Clients from Auth0

Import M2M Clients from Auth0

Stytch's M2M Authentication supports importing clients from other platforms like Auth0. Use Stytch to import pre-existing client_ids, client_secrets, and assigned scopes without any data transformations or downtime.

Before you start

In order to complete this guide, you'll need the following:

  • A Stytch B2B project. If you don't have one already, in the Dashboard, click on your existing project name in the top left corner of the Dashboard, click Create a new project, and then select B2B Authentication.
  • The project_id and secret for the Test environment you would like to use. These values can be accessed from the API keys section of the Stytch dashboard. You'll need to pass these values into the Authorization request header for most Stytch API calls.

Step 1: Access your existing client

First, access your existing client wherever it is stored. For this guide, we'll use Auth0 as an example.

On Auth0 and under Applications, select an already created M2M client.

Auth0 client

You'll need to find and copy the client's values that correspond to the following Stytch M2M Client fields:

  • client_id
  • client_secret

Step 2: Import the client via API or the Dashboard UI

In this guide, you'll use the Dashboard UI to do the import.

In the Dashboard, navigate to M2M Clients and then click the Import button. A popup modal will appear prompting you to enter the client ID and secret.

Import client to Stytch

Enter the client's values you copied from Step 1 and click Import.

Step 3: Add any additional metadata

After the import, you can update the M2M Client with additional metadata like client_name and client_description.

Edit M2M client

More importantly, you can transfer any previously defined scopes during this step. In Auth0, navigate to your client's permissions and record the scopes you want to transfer.

Auth0 permissions

Then in Stytch, scroll down to the Scopes section of the newly imported M2M Client and click + Add scopes. A popup modal will appear prompting you to type in the scopes and separate them by a single space.

Import scopes

Click Save when you've finished editing the M2M Client.

Step 4: Validate the access token's payload

To confirm a successful import, issue an access token for the M2M Client and decode the JWT.

{
  "aud": [
    "PROJECT_ID"
  ],
  "exp": 1693492107,
  "iat": 1693488507,
  "iss": "stytch.com/PROJECT_ID",
  "nbf": 1693488507,
  "scope": "read:users update:users",
  "sub": "lJJsWpAmd42q0EEJHJoSAxTPzdgpzF0i"
}

The access token's payload and standard claims should show the following data:

  • The iss and sub match or contain your project_id.
  • The scope matches the scopes you entered in Step 3.
  • The sub matches the client_id you imported from Steps 1 and 2.

If the criteria are met, your M2M Client has successfully been imported to Stytch.

Before you start

Step 1: Access your existing client

Step 2: Import the client via API or the Dashboard UI

Step 3: Add any additional metadata

Step 4: Validate the access token's payload