Skip to content

Scaffolded host without an auth module returns 500 (no DefaultChallengeScheme) on permission-guarded endpoints #262

@antosubash

Description

@antosubash

Found during module-packaging Session 2 checkpoint.

A fresh sm new project host has AddAuthentication() with no default scheme (auth is expected to come from a module). Any endpoint guarded with RequirePermission — e.g. an installed packaged module's pages or APIs — throws InvalidOperationException ('No authenticationScheme was specified, and there was no DefaultChallengeScheme found') and returns 500 instead of 401/redirect.

Installing a module into a bare scaffold therefore looks broken even though the module is wired correctly. The framework should register a fallback challenge scheme that produces a clean 401 (and a hint that an auth module is missing) when no auth module is installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    packagingModule packaging & distribution

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions