KB-LECA
1.0.0
New versions developed with .NET 8 will be released soon.
dotnet add package KB-LECA --version 1.0.0
NuGet\Install-Package KB-LECA -Version 1.0.0
<PackageReference Include="KB-LECA" Version="1.0.0" />
paket add KB-LECA --version 1.0.0
#r "nuget: KB-LECA, 1.0.0"
// Install KB-LECA as a Cake Addin
#addin nuget:?package=KB-LECA&version=1.0.0
// Install KB-LECA as a Cake Tool
#tool nuget:?package=KB-LECA&version=1.0.0
KB-AspNetMvc-LECA
Logging, error catching and authentication solution for Asp Net Mvc projects. (LECA: Logging - Error Catching - Authentication)
General Information
This nuget automatically catches the errors that occur in the AspNet MVC project to which it is added and adds it to the log file of the relevant day, then directs the user to the Index page in the Home controller. </br>
When any action in any controller is accessed with the LogFilter defined as GlobalFilter in it, it adds this access to the log file of the relevant day. </br>
Again, it ensures that only authorized persons can access the controller or action determined by the AuthFilter included in it, directs the unauthorized persons to the Index page in the Home controller and saves the records of all these operations in the log file of the relevant day. </br>
The descriptions of the codes in the project are available as comments line. For detailed information about the codes, please review the project. (https://github.com/KadirBerat/KB-AspNetMvc-LECA.git)
Tutorial
There is no need to take any action to keep logs related to error catching and access log, this process is carried out automatically by the system.
AuthFilter
User types </br>
- User (Access Level 0)
- Admin (Access Level 1)
- Master Admin (Access Level 2)
- Tester (Access Level 3)
- Developer (Access Level 4) </br>
When defining the AuthFilter, it takes a UserTypes object to identify the user with the lowest access to the controller or action in which it is defined.</br>
If the filter is defined on the controller, when a request is sent to any action in that controller, authorization is checked.
[AuthFilter(UserTypes.Admin)]
public class HomeController : Controller
{
...
}
If the filter is defined on the action, only when a request comes to that action, the authorization is checked.
[AuthFilter(UserTypes.Admin)]
public ActionResult Index()
{
...
}
While defining authorization cookies for access control, it takes a model containing user data into the cookie. </br> The definition of this model is as follows.
CookieModel model = new CookieModel
{
ID = 0,
Username = "admin",
UserType = UserTypes.Admin
};
The process of adding cookies is as follows.
AuthenticationHelper.AddAuthCookie(model);
The process of deleting cookies is as follows.
AuthenticationHelper.DeleteAuthCookie();
The name of the cookie is authcookie.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
- Microsoft.AspNet.Mvc (>= 5.2.7)
- Microsoft.CodeDom.Providers.DotNetCompilerPlatform (>= 2.0.1)
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.0.0 | 244 | 3/22/2022 |
First release of this version.