I have a WebAPI with OAuth2 (Microsoft Identity) and I need to support 'Client Credential Flow' (for non-interactive driven clients, with Roles) as well as 'Autentication Credential Flow' (for human-interactive clients, with Scopes).
How can I make it run with either 'MyRole' or with 'MyScope'? ... when the controller basically looks like this:
[Authorize(Roles = "MyRole")]
[RequiredScope("MyScope")]
public class MyController : ControllerBase
{
}
I work with .NET 6