jeudi 18 février 2021

how to use Authorize with @inherits?

c# with a blazor application

I'm using Microsoft Identity Web to get the scopes from my Azure AD. This is working and I can use

[Authorize(Policy = "GroupAll")]
[AuthorizeForScopes(Scopes = new[] {Constants.ScopeUserRead})]

This is working fine but now I want to create 2 pages with page 1 a different policy then page 2. And page 2 is using @inherits to reuse 99% of the code of page 1.

How do I do this? because the [authorize] code is before the
public partial class classname : ComponentBase

I hope my problem is clear. Sorry im still learning.

Maurice




Aucun commentaire:

Enregistrer un commentaire