All Projects → casbin-net → casbin-aspnetcore

casbin-net / casbin-aspnetcore

Licence: Apache-2.0 License
Casbin.NET integration and extension for ASP.NET Core

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to casbin-aspnetcore

Aspnetcorewindowsauth
Local and Windows Authentication, ASP.NET Core MVC, IdentityServer4
Stars: ✭ 87 (+123.08%)
Mutual labels:  aspnetcore, authorization
RoleBasedAuthWithBlazor
Companion code sample for my blog post - Configuring Role-based Authorization with client-side Blazor
Stars: ✭ 22 (-43.59%)
Mutual labels:  aspnetcore, authorization
Aspnet5identityserverangularimplicitflow
OpenID Connect Code / Implicit Flow with Angular and ASP.NET Core 5 IdentityServer4
Stars: ✭ 670 (+1617.95%)
Mutual labels:  aspnetcore, authorization
Simple aspnet auth
Simple ASP.NET Authorisation boilerplate project. No EF, no database, no IdentityServer4 just a basic logging in system for both cookies and JWT and a controller with a set of examples.
Stars: ✭ 105 (+169.23%)
Mutual labels:  aspnetcore, authorization
Run Aspnetcore Realworld
E-Commerce real world example of run-aspnetcore ASP.NET Core web application. Implemented e-commerce domain with clean architecture for ASP.NET Core reference application, demonstrating a layered application architecture with DDD best practices. Download 100+ page eBook PDF from here ->
Stars: ✭ 208 (+433.33%)
Mutual labels:  aspnetcore, authorization
JwtAuthDemo
ASP.NET Core + Angular JWT auth demo; integration tests; login, logout, refresh token, impersonation, authentication, authorization; run on Docker Compose.
Stars: ✭ 278 (+612.82%)
Mutual labels:  aspnetcore, authorization
XAF Security E4908
This repository contains examples for Role-based Access Control, Permission Management, and OData / Web / REST API Services for Entity Framework and XPO ORM
Stars: ✭ 47 (+20.51%)
Mutual labels:  aspnetcore, authorization
rbac-react-redux-aspnetcore
A starter template for creating JWT token from ASP.NET Core API project and applying that JWT token authentication on React application
Stars: ✭ 54 (+38.46%)
Mutual labels:  aspnetcore, authorization
authorization-proxy
No description or website provided.
Stars: ✭ 31 (-20.51%)
Mutual labels:  authorization
AspSqliteCache
An ASP.NET Core IDistributedCache provider backed by SQLite
Stars: ✭ 39 (+0%)
Mutual labels:  aspnetcore
authorized-attributes
Authorized Model Attributes for Laravel
Stars: ✭ 22 (-43.59%)
Mutual labels:  authorization
restify-jwt-community
Restify middleware that validates a JsonWebToken
Stars: ✭ 24 (-38.46%)
Mutual labels:  authorization
Home
Asp.net core Mvc Controls Toolkit
Stars: ✭ 33 (-15.38%)
Mutual labels:  aspnetcore
node-js-jwt-auth
Node.js Demo for Token Based Authentication (JWT) with MySQL database
Stars: ✭ 161 (+312.82%)
Mutual labels:  authorization
powerauth-crypto
PowerAuth - Open-source solution for authentication, secure data storage and transport security in mobile banking.
Stars: ✭ 48 (+23.08%)
Mutual labels:  authorization
open-psd2
An open source framework for using banking API's built for PSD2 regulation.
Stars: ✭ 20 (-48.72%)
Mutual labels:  authorization
django-sitegate
Reusable application for Django to ease sign up & sign in processes
Stars: ✭ 32 (-17.95%)
Mutual labels:  authorization
keyonic-v2
A Keycloak Mobile Implementation using Angular v4 and Ionic v3
Stars: ✭ 23 (-41.03%)
Mutual labels:  authorization
authz0
🔑 Authz0 is an automated authorization test tool. Unauthorized access can be identified based on URLs and Roles & Credentials.
Stars: ✭ 248 (+535.9%)
Mutual labels:  authorization
spartan
A Scalable Client Authentication & Authorization System for Container-based Environments
Stars: ✭ 17 (-56.41%)
Mutual labels:  authorization

Casbin.AspNetCore

Actions Status Coverage Status License Build Version

Casbin.AspNetCore is a Casbin.NET integration and extension for ASP.NET Core.

Installation

This project is on developing, You can install the build version to try it.

dotnet add package Casbin.AspNetCore --version <build package version> --source https://www.myget.org/F/casbin-net/api/v3/index.json

Or you create a NuGet.config file on you solution directory like this.

<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="myget.org" value="https://www.myget.org/F/casbin-net/api/v3/index.json" />
  </packageSources>
</configuration>

Quick Start

You should add the service at ConfigureServices method and add MiddleWare at Configure method like this:

public void ConfigureServices(IServiceCollection services)
{
    // Other codes...

    //Add Casbin Authorization
    services.AddCasbinAuthorization(options =>
    {
        options.DefaultModelPath = "<model path>";
        options.DefaultPolicyPath = "<policy path>";
    });
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
    // Other codes...

    app.UseCasbinAuthorization();

    // You can add this to support offical authorization too.
    app.UseAuthorization();

    // Other codes...
}

Now you can use the attribute like offical authorization, If you use the Basic Model, It will like this:

[CasbinAuthorize("<obj>", "<act>")]
public IActionResult Index()
{
    return View();
}

Usages

Head over to the usages on the wiki to know all the features.

How It Works

Head over to the how it works on the wiki for user guidance on how it works.

Samples

Sample applications using Casbin.AspNetCore can be found at sample directory.

Getting Help

License

This project is under Apache 2.0 License. See the LICENSE file for the full license text.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].