title: Apply AuthorizeForScopesAttribute in the whole application
body: <p>I have a Razor pages application.
  I am using MS Identity Platform Application. Now I need to acquire silently the tokes so I can call some APIs.</p>
  <p>Everything works, but I have a portion of code is repeated for all pages:</p>
  <pre><code>[Microsoft.Identity.Web.AuthorizeForScopes(ScopeKeySection = &quot;AdminApi:Scope&quot;)]
  public class MyModel : PageModel
  {
     ...
  }
    
  </code></pre>
  <p>Exist a way to apply that attribute to the whole my application?</p>
  <p>I have tryed something like that:</p>
  <pre><code>services.AddRazorPages(options =&gt;
  {
      options.Conventions.AddAreaFolderApplicationModelConvention(
          &quot;MyArea&quot;, &quot;/MyAreaFolder&quot;,
          model =&gt; model.Filters.Add(new Microsoft.Identity.Web.AuthorizeForScopesAttribute() { ScopeKeySection = &quot;AdminApi:Scope&quot; }));
  })
          .AddMicrosoftIdentityUI();
  </code></pre>
  <p>I have also tryed using:
  <code>AddAreaFolderApplicationModelConvention</code>
  <code>AddAreaPageApplicationModelConvention</code>
  <code>AddPageApplicationModelConvention</code></p>
  <p>No solution works. What can I try?</p>
  <p>Thank you</p>