RT.MesWeb.Authentication 1.0.1

dotnet add package RT.MesWeb.Authentication --version 1.0.1
                    
NuGet\Install-Package RT.MesWeb.Authentication -Version 1.0.1
                    
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="RT.MesWeb.Authentication" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RT.MesWeb.Authentication" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="RT.MesWeb.Authentication" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RT.MesWeb.Authentication --version 1.0.1
                    
#r "nuget: RT.MesWeb.Authentication, 1.0.1"
                    
#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.
#:package RT.MesWeb.Authentication@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RT.MesWeb.Authentication&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=RT.MesWeb.Authentication&version=1.0.1
                    
Install as a Cake Tool

Authentication 使用说明

配置要求

  • 需要在 appsettings.json 中添加以下配置:
    "Authentication": {
        "AuthEntities": {
            "ConnectionString": "Server=127.0.0.1;uid=sa;pwd=password;database=dbname;Trust Server Certificate=true;",
            "DatabaseType": "SqlServer" // 可选值:SqlServer / Oracle
        },
        "SystemAccount": {
            "AdminRoleName": "administrator",
            "AdminUserName": "admin",
            "DefaultPassword": "mes123"
        },
        "ThreeManager": {
            "EnableThreeManager": false,
            "SystemManagerUserName": "110101199001010001",
            "SecurityManagerUserName": "110101199001010002",
            "SecurityAuditorUserName": "110101199001010003",
            "SystemManagerRoleName": "系统管理员",
            "SecurityManagerRoleName": "安全管理员",
            "SecurityAuditorRoleName": "安全审计员",
            "SystemManagerPermissions": "",
            "SecurityManagerPermissions": "",
            "SecurityAuditorPermissions": ""
        },
        "AccessControl": {
            "AllowMultiTerminal": false,
            "SessionTimeoutSeconds": 200,
            "HeartbeatIntervalSeconds": 60,
            "Lockout": {
                "MaxFailedAccessAttempts": 5,
                "DefaultLockoutMinutes": 30,
                "InactiveDaysToLock": 90
            },
            "PasswordPolicy": {
                "ExpiryDays": 180,
                "ReminderDaysBeforeExpiry": 7,
                "RequiredLength": 8,
                "ComplexityRegex": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$",
                "AllowRepeatWithLast": false
            }
        }
    },
}

数据库要求

  • AuthEntities指向的数据库应当全套权限认证体系的数据表
  • AuthEntities指向的数据库应当包含以下序列:
    • AUTH_SEQ_NO:用于生成数据表编号的序列。
  • 数据库中应包含序号生成机制
    • SQL Server:应包含生成Sequence的存储过程和Sequence序列对象
    • Oracle:包含生成Sequence的序列对象即可

使用说明

  • Authentication服务配置:
// 在MesWebApiHostModule中增加对AuthenticationApiModule的依赖:
[DependsOn(
        typeof(AuthenticationApiModule)
        )]
  • AuthEntities需要在主工程内进行依赖注入,直接通过以下方法进行注册:
services.ConfigureAuthentication(configuration);
  • Authentication有授权检查,需要在主工程内启动授权服务(授权配置参见RT.MesWeb.Framework中的README):
MesLicenseChecker.Current.Start(configuration, hostEnvironment.ContentRootPath, logger);
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows 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.0.1 93 5/8/2026
1.0.0 101 4/27/2026