cover-img

Attribute-Based Access Control Sample for a .Net Core API Application

22 March, 2023

0

0

0

Attribute Based Access Control Sample for a .Net Core API Application

This is a simple demo sample on implementing ABAC in a .Net Core API Application. This uses three main aspects of Attributes => ACCESS, SCOPE, and MODULE.

Key Points

  1. Access, Scope, and Module attributes are used
  1. It is possible to extend this sample to accommodate as many attributes as needed
  1. No External libraries were used
  1. Handled all the necessary authn and authz in the handlers itself.
  1. Optional takeaway - added an additional path for restricting resources in PermissionsAuthHandler.cs#L60

To Explore

  1. Clone and run the code
  1. Generate a JWT token with email/sub and exp. Applicable emails can be found in TestUsers.cs
  1. Add the generated JWT token in the swagger authorization menu and call the APIs

0

0

0

Venkatesan Rethinam
Web architect cum developer working in .NET with Azure

More Articles

Showwcase is a professional tech network with over 0 users from over 150 countries. We assist tech professionals in showcasing their unique skills through dedicated profiles and connect them with top global companies for career opportunities.

© Copyright 2025. Showcase Creators Inc. All rights reserved.