Authentication
Control Studio access through the host's ASP.NET Core identity and roles.
Studio evaluates HttpContext.User from your application. It does not create a separate user store or login system.
Choose one access mode
| Option | Who can access Studio |
|---|---|
AllowAnonymous() | Anyone who can reach the surface; useful in local development. |
RequireAuthenticatedUser() | Any signed-in host user. |
RequireRole("Admin") | A signed-in user with the matching role. |
An access mode is required. Select one per dashboard configuration.
Configure the host first
This example uses cookie authentication and restricts Studio to an Admin role. The application must implement its own login and access-denied pages and issue authenticated identities.
Authentication middleware must run before Studio evaluates the user. Configuring RequireRole does not issue roles; it checks the host identity's existing role claims.
Understand denied requests
For an anonymous request, Studio calls the host's authentication challenge when a default scheme is available; otherwise it returns HTTP 401.
For a signed-in user who lacks access, Studio calls the host's forbid handler when available; otherwise it returns HTTP 403. Redirects or response codes then depend on the authentication handler and request. Do not assume every failed request redirects to a login page.
Check the boundary
The configured Studio path and its inspection APIs use this access check. A separate application endpoint or MCP route needs its own host policy.
Test an anonymous request, an authenticated user without the required role, and an authorized user. Protect the surface according to the operations and runtime data it exposes.