UserManagement.Core
1.2.2
dotnet add package UserManagement.Core --version 1.2.2
NuGet\Install-Package UserManagement.Core -Version 1.2.2
<PackageReference Include="UserManagement.Core" Version="1.2.2" />
paket add UserManagement.Core --version 1.2.2
#r "nuget: UserManagement.Core, 1.2.2"
// Install UserManagement.Core as a Cake Addin #addin nuget:?package=UserManagement.Core&version=1.2.2 // Install UserManagement.Core as a Cake Tool #tool nuget:?package=UserManagement.Core&version=1.2.2
UserManagement
It allows to manage user access through roles and permissions in an Intranet applications. It uses easily and is easily reusable.
It is necessary to download the following Packages
- UserManagement.Core
- UserManagement.SqlServer
- UserManagement.Security
Currently it is only possible to use a DB SQL SERVER.
Installation
To use 'application user management is necessary to enter this section of code in the Owin Start Class.
GlobalConfiguration.Configuration
.UseSqlServerStorage("<SQL Connection>"
,new SqlServerStorageOptions());
The ** SqlServerStorageOptions ** Class has the following properties:
- PrepareSchemaIfNecessary
- Indicate if you need to create the schema (default true)
- TransactionTimeout
- Time Out for SQL transactions
- CommandTimeout
- Time Out for SQL commands
- SchemaName
- Indicates the name of the Schema which create tables (default UserManagement UserManagement)
To view the Dashboard will also need to add one more row in the Start Owin file
app.UseUserManagerDashboard("Name App");
This call is also possible to add options through the class DashboardOptions
- AppPath (Path of the reference Intranet application)
- Authorization (Management of internal permissions to UserManagement)
- DisplayStorageConnectionString (Viewing the connection string)
- DashboardTitle (DashBoard title)
Usage Example
GlobalConfiguration.Configuration.UseSqlServerStorage("Server=name_server; Database=DBGeneric; user id=User234;password=User234", new SqlServerStorageOptions { CommandTimeout = TimeSpan.FromMinutes(5) }); app.UseUserManagerDashboard("/Admin");
Writing the above, it will be possible to view the DashBoard by typing the word Admin in the URL (ex: http://myproject.com/Admin)
Authorization Management
In the Security package we find two classes.
- UserManagementAuthorize
- Attribute used to manage authorizations
- UserManagementFormAuthentication
- Contains two functions SigIn and SigOut (for access management with Web form)
UserManagementAuthorize
It can be used on methods, property classes and manages access to the resource. Allows you to define Rules, Permissions and Users divided by ";"
Example
[UserManagementAuthorize(Roles ="R1;R2")] public ActionResult About() { ViewBag.Message = "Your application description page."; return View(); }
UserManagementFormAuthentication
If you use Form authentication we have two static methods available:
- SigIn(string userName, string password)
- SigOut()
These allow the user to login and logout.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
-
.NETFramework 4.7.2
- Microsoft.Owin (>= 4.1.0)
- Newtonsoft.Json (>= 12.0.3)
- Owin (>= 1.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on UserManagement.Core:
Package | Downloads |
---|---|
UserManagement.SqlServer
SQL Server 2008+ (including Express), SQL Server LocalDB support for UserManagement |
|
UserManagement.Security
Manage access to the application |
GitHub repositories
This package is not used by any popular GitHub repositories.
use with UserManagement.SqlServer and UserManagement.Security