>>105954147in your startup.cs just add like
services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(configuration)
//or
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApi(configuration)
or similar depending on your identity provider. You do have an identity provider right? If not you can also just do basic auth with cookies. The wizard can set it up for you on project creation.