-
Notifications
You must be signed in to change notification settings - Fork 2
Home
ChustaSoft.Authorization is a tool based on Microsoft ASPNETCore Identity thought to have an easy and clear implementation and configuration of the tool inside a project with JWT authentication.
ChustaSoft.Authorization is also prepared to manage extended contexts, so if the target project requieres additional properties or relations it will also be able to handle it, otherwise, you also have the possibility of just use the default implementation inside.
With the version 2.0, the tool is now compatible with .NET Core 3.1, and is divided in two different packages:
- ChustaSoft.Tools.Authorization: Main package, it contains the services, models and database context using Microsoft AspNet Identity features, isolating and extending in different services.
- ChustaSoft.Tools.Authorization.AspNet: Package for adding controllers to the target project exposing main functionalities like Login or Register in a REST Controller.
There are two different ways to use it, the default one, and the custom:
If the project doesn't requiere any additional functionality or information stored in the context provided by the Authorization tool, it is possible to use the default implementation provided internally by the tool. As a level services, the tool can provide of the different services:
- ISessionService
- Task AuthenticateAsync(Credentials credentials)
- Task RegisterAsync(Credentials credentials)
- IUserService
Task<User> GetAsync(Guid userId)
Task<TUser> GetByUsername(string username, string password)
Task<TUser> GetByEmail(string email, string password)
Task<bool> CreateAsync(User user, string password)