Skip to content

Intility/Authorization-Azure-GuestPolicies

Repository files navigation

Intility.Authorization.Azure.GuestPolicies

Deny guests users in the authorization flow.

Build_and_Test Publish codecov

Nuget Nuget

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();
});