title: @attribute [AllowAnonymous] in Blazor server-side component has no effect
body: <p>I have created a fresh Blazor server-side project with .NET Core 3.0 and have closed down the application for non-authenticated users. </p>
  
  <p>I am now trying to allow anonymous access to Index.razor component by placing [AllowAnonymous] at the top of the file. This however, does not seem to do anything.</p>
  
  <p><strong>Scenario</strong></p>
  
  <p>After using the default Blazor template "WeatherForecast" I added the following to <strong>Startup.cs</strong></p>
  
  <pre><code>services.AddMvcCore(options =&gt;
  {
      var policy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
      options.Filters.Add(new AuthorizeFilter(policy));
  });
  </code></pre>
  
  <p>This piece of code blocks all requests toward my application if the user is not authenticated.</p>
  
  <p>After adding that piece of code I would like to open up the default <strong>Index.razor</strong> component for non-authenticated users. I do that by adding <strong>@attribute [AllowAnonymous]</strong> to Index.razor:</p>
  
  <pre><code>@page "/"
  @attribute [AllowAnonymous]
  
  &lt;h1&gt;Hello, world!&lt;/h1&gt;
  
  Welcome to your new app.
  </code></pre>
  
  <p><strong>App.razor</strong></p>
  
  <pre><code>&lt;Router AppAssembly="@typeof(Program).Assembly"&gt;
  &lt;Found Context="routeData"&gt;
      &lt;AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" /&gt;
  &lt;/Found&gt;
  &lt;NotFound&gt;
      &lt;CascadingAuthenticationState&gt;
          &lt;LayoutView Layout="@typeof(MainLayout)"&gt;
              &lt;p&gt;Sorry, there's nothing at this address.&lt;/p&gt;
          &lt;/LayoutView&gt;
      &lt;/CascadingAuthenticationState&gt;
  &lt;/NotFound&gt;
  &lt;/Router&gt;
  </code></pre>
  
  <p><strong>Expected result</strong> </p>
  
  <p>When running my application non-authenticated users would be allowed to visit the index page at <a href="https://localhost:XXXX" rel="noreferrer">https://localhost:XXXX</a></p>
  
  <p><strong>Actual result</strong></p>
  
  <p>My users are forwarded to my OpenIdConnect URI.</p>