githubEdit

Disable Auth in Development

Guide for disabling authentication in Elsa Server and Studio during development to simplify local testing and experimentation.

This guide explains how to disable authentication and authorization in Elsa Server and Studio for development and testing purposes only. Disabling authentication simplifies local development, prototyping, and learning Elsa without the complexity of setting up identity providers.

triangle-exclamation

When to Disable Authentication

Disabling authentication is appropriate for:

  • Local development: Testing workflows on your development machine

  • Learning Elsa: Exploring features without authentication complexity

  • Proof of concepts: Quick prototypes and demos

  • Integration tests: Automated testing without auth overhead

  • Docker Compose local stacks: Development containers on localhost

When NOT to Disable Authentication

Never disable authentication for:

  • Production deployments: Any environment accessible outside your local machine

  • Staging environments: Pre-production testing should mirror production security

  • Shared development environments: Multiple developers or accessible from network

  • Cloud deployments: Any deployment to AWS, Azure, GCP, or other cloud platforms

  • Kubernetes clusters: Even development clusters should have basic auth

Methods for Disabling Authentication

There are several approaches to disable authentication in Elsa, depending on your setup and requirements.

Method 1: Disable Endpoint Security (Simplest)

This is the easiest method and disables authentication for all Elsa API endpoints.

Program.cs:

Key Points:

  • DisableSecurity() removes all authorization requirements from Elsa API endpoints

  • Wrap in if (builder.Environment.IsDevelopment()) to prevent accidental production use

  • No authentication middleware needed

Method 2: Bypass Authorization with AllowAnonymous

Configure authorization policies to allow all requests:

Program.cs:

Method 3: Disable Elsa Identity Module

If you've configured Elsa.Identity, you can disable it for development:

Program.cs:

Method 4: Configuration-Based Toggle

Use configuration files to toggle authentication:

appsettings.Development.json:

appsettings.Production.json:

Program.cs:

Disabling Authentication in Elsa Studio

When disabling authentication in Elsa Server, you also need to configure Elsa Studio to not send authentication credentials.

Studio Configuration

Program.cs (Studio app):

Docker Compose Example

For local development with Docker Compose, disable authentication in both Server and Studio:

docker-compose.yml:

Testing with Disabled Authentication

Once authentication is disabled, you can access Elsa APIs directly:

Test API Access

Test Studio Access

Navigate to Studio in your browser:

You should be able to:

  • View all workflows

  • Create and edit workflows

  • Execute workflows

  • View workflow instances

All without logging in.

Security Considerations for Development

Even with authentication disabled in development, follow these practices:

1. Restrict Network Access

Bind to localhost only:

Docker Compose (localhost only):

2. Use Separate Development Database

Never point development environments to production databases:

3. Firewall Rules

Ensure development machines have firewall rules blocking external access to Elsa ports.

4. Environment Checks

Always wrap disabled auth in environment checks:

Re-Enabling Authentication for Production

Before deploying to production, remove all authentication disabling code and enable proper security:

For production authentication options, see:

Troubleshooting

Studio Still Prompts for Login

Cause: Studio authorization is still enabled.

Fix: Ensure Studio is configured without authentication requirements:

Also verify that Elsa Server has disabled security (see Method 1 above).

API Returns 401 Unauthorized

Cause: UseAuthentication() or UseAuthorization() middleware is still active, or DisableSecurity() wasn't called.

Fix: Ensure you've disabled security before building the app:

Cannot Access from Another Machine on Network

Cause: Application is bound to localhost only.

Fix (Development Only): Bind to all interfaces:

circle-exclamation

Next Steps


Last Updated: 2025-12-02 Addresses Issues: #15

Last updated