.NET Core API Conditional Authentication attributes for Development & Production : <p>Long story short, Is it possible to place an environment based authorization attribute on my API so that the authorization restriction would be turned off in development and turned back on in Production?  </p>

<p>I have a separate Angular 2 project that I wish to call a .NET Core API with.  We created a separate project so we could open the Angular 2 project in vscode and debug the typescript.  When we are finished, we will build the project and place it inside the .NET Core project for security reasons.  </p>

<p>Our problem is that during the debugging stages, we are unable to connect to the API because they are two separate projects and our Angular 2 project does not have Active Directory.  The .NET Core project currently has Authentication Attributes and wont allow access (401) to the API.  It would be nice if we could turn that off during development and back on during production.</p>

<p>I'm also open to any other suggestions on how we can best solve this problem.</p>

<pre><code>[Authorize: (Only in Production)] &lt;-- // something like this???
[Route("api/[controller]")]
public class TestController : Controller
{
    ...
</code></pre>
