Tel Map


ASP.NET Core 2.0 Disable Authentication in Development Environment

This article describes how to disable authentication for ASP.NET Core 2.0.

ASP.NET Core JWT Authentication

I have some Rest API which I want to protect via JwtBearer token in production e.g.


However in order to test the API, for development I totally want to disable authentication without having to remove all Authorizes in the Controllers.

First Attempt

If you however try something like this:

you will run into the following error:

An unhandled exception occurred while processing the request.

InvalidOperationException: No authenticationScheme was specified, and there was no DefaultChallengeScheme found.


It took the quite some time to figure out a valid solution. And it is very simpe as well…
What I ended up doing is this:


Now everyone can access the API in development. Hope this helps someone solve this problem.

If you have any questions or further information, please leave a comment below.


7 Antworten auf „ASP.NET Core 2.0 Disable Authentication in Development Environment“

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Diese Seite verwendet Cookies. Durch die weitere Nutzung der Webseite stimmen Sie der Verwendung von Cookies zu. Weitere Informationen zu Cookies erhalten Sie in unserer Datenschutzerklärung.