UserManagement.SqlServer 1.2.4

dotnet add package UserManagement.SqlServer --version 1.2.4                
NuGet\Install-Package UserManagement.SqlServer -Version 1.2.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="UserManagement.SqlServer" Version="1.2.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UserManagement.SqlServer --version 1.2.4                
#r "nuget: UserManagement.SqlServer, 1.2.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install UserManagement.SqlServer as a Cake Addin
#addin nuget:?package=UserManagement.SqlServer&version=1.2.4

// Install UserManagement.SqlServer as a Cake Tool
#tool nuget:?package=UserManagement.SqlServer&version=1.2.4                

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

  1. UserManagement.Core
  2. UserManagement.SqlServer
  3. 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:

  1. PrepareSchemaIfNecessary
    • Indicate if you need to create the schema (default true)
  2. TransactionTimeout
    • Time Out for SQL transactions
  3. CommandTimeout
    • Time Out for SQL commands
  4. 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.

  1. UserManagementAuthorize
    • Attribute used to manage authorizations
  2. 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:

  1. SigIn(string userName, string password)
  2. SigOut()

These allow the user to login and logout.

Product Compatible and additional computed target framework versions.
.NET Framework net472 is compatible.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.4 581 10/6/2020
1.2.2 497 10/6/2020 1.2.2 is deprecated because it has critical bugs.
1.2.1 476 8/24/2020

Nothing