title: Allow anonymous in conventional routing endpoint ASP .Net Core
body: <p>I have a route that I want to allow anonymous configured like the following: </p>
  
  <pre><code>        app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                 name: "myEndpoint",
                 template: "myendpoint",
                 defaults: new { controller = "MyEndpoint", action = nameof(MyEndpoint.Get) }
              );
          });
  </code></pre>
  
  <p>The issue is that it redirects me to the oAuth page, I want <code>myendpoint</code> to allow anonymous users and bypass the oAuth page. I tried using the <code>AllowAnonymous</code> attribute in the method and class with no success.</p>
  
  <p>This is my controller:</p>
  
  <pre><code>namespace MyNamespace
  {
     /// &lt;summary&gt;
     /// My Endpoint API
     /// &lt;/summary&gt;
     public class MyEndpointController : Controller
     {
         public MyEndpointController()
         {
         }
  
         /// &lt;summary&gt;
         /// My Endpoint
         /// &lt;/summary&gt;
         public MyInfo Get()
         {
             return new Data
             {
                Data = Value
             };
         }
     }
  }
  </code></pre>