/
Contact usSee pricingStart building
Node
​

    About Stytch

    Introduction
    Integration Approaches
      Full-stack overview
      Frontend (pre-built UI)
      Frontend (headless)
      Backend
    Migrations
      Migration overview
      Migrating users statically
      Migrating users dynamically
      Additional migration considerations
      Zero-downtime deployment
      Defining external IDs for users
      Migrating from Stytch Consumer to B2B
      Exporting from Stytch
    Custom Domains
      Overview

    Authentication

    DFP Protected Auth
      Overview
      Setting up DFP Protected Auth
      Handling challenges
    Magic Links
    • Email Magic Links

      • Getting started with the API
        Getting started with the SDK
        Replacing your password reset flow
        Building an invite user flow
        Add magic links to an existing auth flow
        Adding PKCE to a Magic Link flow
        Magic Link redirect routing
    • Embeddable Magic Links

      • Getting started with the API
    MFA
      Overview
      Backend integration
      Frontend integration
      Remembered device flow
    Mobile Biometrics
      Overview
    M2M Authentication
      Authenticate an M2M Client
      Rotate client secrets
      Import M2M Clients from Auth0
    OAuth
    • Identity providers

      • Overview
        Provider setup
      Getting started with the API (Google)
      Add Google One Tap via the SDK
      Email address behavior
      Adding PKCE to an OAuth flow
    Connected AppsBeta
      Setting up Connected Apps
      Client types
    • Integration Guides

      • Integrate with AI agents
        Integrate with MCP servers deployed on Cloudflare
        Integrate with MCP servers on Vercel
        Integrate with CLI Apps
    • Resources

      • About Remote MCP Servers
        Consent Management
    Passcodes
      Getting started with the API
      Getting started with the SDK
    • Toll fraud

      • What is SMS toll fraud?
        How you can prevent toll fraud
      Unsupported countries
    Passkeys & WebAuthn
    • Passkeys

      • Passkeys overview
        Set up Passkeys with the frontend SDK
    • WebAuthn

      • Getting started with the API
        Getting started with the SDK
    Passwords
      Getting started with the API
      Getting started with the SDK
      Password strength policy
    • Email verification

      • Overview
        Email verification before password creation
        Email verification after password creation
    Sessions
      How to use sessions
      Backend integrations
      Frontend integrations
      Custom claims
      Custom claim templates
      Session tokens vs JWTs
      How to use Stytch JWTs
    TOTP
      Getting started with the API
      Getting started with the SDK
    Web3
      Getting started with the API
      Getting started with the SDK
    Trusted Auth Tokens
      How to use Trusted Auth Tokens

    RBAC

    Resources
      Overview
      Role assignment
    Integration Guides
      Start here
      Backend integration
      Headless frontend integration
      (Legacy) Implement RBAC with metadata

    3rd Party Integrations

    Planetscale
    Supabase
    Feathery
    Unit

    Testing

    E2E testing
    Sandbox values
Get support on SlackVisit our developer forum

Contact us

Consumer Authentication

/

Guides

/

RBAC

/

Integration Guides

/

Start here

Getting Started with Stytch RBAC

Before getting started with integrating RBAC with Stytch, go to the Stytch Dashboard RBAC Policies page to enable some custom RBAC settings for your project.

Create custom resources and actions

Navigate to "Resources" and "Create New Resource", where you will add a resource_id and actions. Resources represent entities within your application that a user might act upon, and Actions for a Resource are the valid operations for that Resource. Together these form a permission that a user would be authorized or not authorized to take.

RBAC Resources in Stytch Dashboard

For example, if your application has documents, you might create a ResourceID of document with create update delete and download as the Actions.

RBAC Resources in Stytch Dashboard

2
Assign permissions to roles

After creating your custom Resource, you can navigate to the "Roles" tab. You will see one default Role:

  • stytch_user: this Role is automatically assigned to all Users, and enables basic permissions that you'd want any User of your application to have -- such as updating their own name.

You can edit the permissions associated with this Role, and can also create your own custom Roles.

When you add permissions to a Role, you will select the Resource and then can explicitly assign a subset of permissions to that Role. For example, you might give the stytch_user Role permission to take the create and update Actions on document Resources but not allow download or delete Actions.

RBAC Grant Subset of Permissions

You can also grant the Role the "wildcard" Action, which allows Users with that Role to take any defined Action on the Resource. This is helpful for situations where the Role should always have complete control over the Resource, even as new permissions are added.

RBAC Wildcard Actions Grant

3
Implement backend RBAC checks

Even if you are leveraging Stytch's frontend SDKs, it is critical that you add server-side authentication and authorization checks before honoring requests from your client.

Read the backend integration guide to learn how to properly authorize requests on your backend.

4
Add frontend RBAC handling

If you are using Stytch's frontend SDKs, follow the headless frontend integration guide to leverage Stytch's RBAC product client-side.

Create custom resources and actions

2.

Assign permissions to roles

3.

Implement backend RBAC checks

4.

Add frontend RBAC handling