Deny guests users in the authorization flow.
Install the Intility.Authorization.Azure.GuestPolicies NuGet package
Install-Package Intility.Authorization.Azure.GuestPolicies
Then, add the policy to the AuthorizationPolicyBuilder
:
builder.Services.AddDenyGuestsAuthorization();
builder.Services.AddAuthorization(options =>
{
options.DefaultPolicy = new AuthorizationPolicyBuilder()
.DenyGuests()
.Build();
});