title: Custom `AuthenticationStateProvider` Authentication Failing
body: <p>I have created a custom <code>ApiAuthenticationStateProvider</code> that after returning an <code>AuthenticationState</code> is still stating</p>
  <pre><code>info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
        Authorization failed.
  </code></pre>
  <p>Here is a simplified version of my <code>ApiAuthenticationStateProvider</code> that is failing:</p>
  <pre><code>public class ApiAuthenticationStateProvider : AuthenticationStateProvider
  {
     public override Task&lt;AuthenticationState&gt; GetAuthenticationStateAsync()
     {
         Console.WriteLine(&quot;Getting auth state...&quot;);
                 
         var claims = new[] { new Claim(ClaimTypes.Name, &quot;some.email@somewhere.com&quot;) };
         var authenticatedUser = new ClaimsPrincipal(new ClaimsIdentity(claims));
         var authState = Task.FromResult(new AuthenticationState(authenticatedUser));
  
         return Task.FromResult(authState);
     }
  }
  </code></pre>
  <p>I can tell from the <code>Console.WriteLine</code> that is using my custom provider but to provide full details, here is the code i used to add that in <code>Program.cs</code>:</p>
  <p><code>builder.Services.AddScoped&lt;AuthenticationStateProvider, ApiAuthenticationStateProvider&gt;();</code></p>