Movensys.Login.Core 1.1.0

dotnet add package Movensys.Login.Core --version 1.1.0
                    
NuGet\Install-Package Movensys.Login.Core -Version 1.1.0
                    
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="Movensys.Login.Core" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Movensys.Login.Core" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Movensys.Login.Core" />
                    
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 Movensys.Login.Core --version 1.1.0
                    
#r "nuget: Movensys.Login.Core, 1.1.0"
                    
#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 Movensys.Login.Core@1.1.0
                    
#: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=Movensys.Login.Core&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Movensys.Login.Core&version=1.1.0
                    
Install as a Cake Tool

Movensys.Login

This is a function for login with keep time, account level, quick login and touch panel login developed by the Movensys Application Team.

Features

  • Easy to use based on enum (define your own level enum, any number of levels)
  • One file LoginConfig.json next to the executable, or in a folder / file you choose
  • Created with admin / 1234 when the file does not exist. The first login of that new file must change the password
  • Login keep time 5 / 10 / 30 / 60 min or unlimited, remain time, "almost expired" event and extend (reset the remain time)
  • The last chosen keep time is remembered
  • Account add / delete / level change. The highest level of your enum is the administrator
  • Quick login : a shortcut key logs in a chosen account at once. On / off and the key are set by an administrator
  • Touch panel login : when your application reports the panel connected, the touch account is logged in without time limit
  • PBKDF2-HMAC-SHA256 password hash (600,000 iterations, 16 byte salt). No plain text password in the file
  • Hide file option (hidden attribute is set on every save)
  • Nothing is shown or logged unless you connect the events
  • .NET Framework 4.5 ~ 4.8.1, .NET 5 and .NET 8 without any other package

Code Highlighting

using Movensys.Login;

namespace WinFormsApp1
{
    //Define Level (higher value = higher level, the highest value = administrator)
    enum MyLevel
    {
        Operator,
        Engineer,
        Admin
    }

    internal static class Program
    {
        [STAThread]
        static void Main()
        {
            //Connect the events you need. Nothing is shown or logged unless you connect them.
            Login<MyLevel>.Audited         += entry => LogHelper<MyLogger>.GetLogger(MyLogger.Audit).INFORMATION(entry.ToString());
            Login<MyLevel>.SessionExpiring += remain => ShowWarning(remain);     //almost expired (60 s by default), once
            Login<MyLevel>.SessionExpired  += () => StopManualOperation();       //logged out by time

            //Add Init
            Login<MyLevel>.Init();                      //Init(@"D:\Config") => D:\Config\LoginConfig.json

            //Use Example
            Login<MyLevel>.LogIn("admin", "1234", 30);  //keep 30 min, 0 => unlimited
            TimeSpan remain = Login<MyLevel>.RemainTime;
            Login<MyLevel>.Extend();                    //remain time = 30 min again

            if (Login<MyLevel>.IsLevel(MyLevel.Engineer))   //current level >= Engineer
                OpenRecipeEditor();

            //Touch panel : the library does not detect the device. Connect it to your own IO.
            Login<MyLevel>.SetTouchPanel(touchPanelConnected);

            ApplicationConfiguration.Initialize();
            Application.Run(new Form1());

            Login<MyLevel>.Release();
        }
    }
}

Tip

The highest value of your level enum is the administrator. Only an administrator session can add / delete accounts, change levels and change the quick login, touch account and hide file settings. The last administrator account cannot be deleted or lowered.

IsLevel(level) is false when nobody is logged in and while the initial password is not changed yet. A level name in the file that is not in your enum is treated as the lowest level. If you rename the administrator level of your enum, delete LoginConfig.json once (it is created again with admin / 1234).

Quick login (QuickLogIn) has no password. The key is handled by the login dialog of Movensys.Login.WinForms. Keep it off unless it is needed, and change the key when it becomes known.

SetTouchPanel(true) logs in the touch account without time limit when nobody is logged in. If someone is already logged in, that session stays, and the touch account takes over when it logs out or expires. SetTouchPanel(false) logs out the touch session only. You can call it every IO scan with the same value. The default touch account has a random password, so it cannot be used from the login dialog.

After 5 failures in a row the next login waits 1 s, then 2, 4, 8 ... up to 300 s. There is no permanent lock, so an administrator can never be locked out for good.

Session events are raised from the monitor thread, not the UI thread. Use Movensys.Login.WinForms (LoginUi<T>) to receive them on the UI thread.

LogIn, ChangePassword and AddAccount block the calling thread because of the 600,000 PBKDF2 iterations. Measured on one PC : about 0.12 s on .NET 8, about 1.7 ~ 2.0 s on .NET Framework 4.6.2 and 4.8. This cost is intentional and slows down brute force attacks. Movensys.Login.WinForms shows a wait cursor during it.

When the session expires the library only raises SessionExpired. It never touches equipment that is already moving. Deciding what to stop is up to your application.

Configuration File (LoginConfig.json)

{
  "Version": 1,
  "Setting": {
    "LastKeepMinutes": 30,
    "ExpiringWarnSeconds": 60,
    "HideFile": false,
    "QuickLogin": { "Enabled": false, "Key": "Ctrl+Shift+Q", "Account": "" },
    "TouchLogin": { "Account": "touch" }
  },
  "Accounts": [
    { "Name": "admin", "Level": "Admin", "Hash": "$pbkdf2-sha256$i=600000$<salt>$<hash>", "MustChangePassword": true },
    { "Name": "touch", "Level": "Operator", "Hash": "$pbkdf2-sha256$i=600000$<salt>$<hash>" }
  ]
}
  • Init(path) / SetFilePath(path) : a path ending with .json is the file, any other path is a folder (<folder>\LoginConfig.json). The path is not saved, so pass it on every start.
  • SetFilePath while running : if the file exists there it is loaded, otherwise it is created with the current content. The current session stays.
  • A path that cannot be used (ex. a drive that only existed on another PC) falls back to the executable folder (IsFilePathFallback).
  • The file is written through a temporary file and then replaced, so a half-written file is never left. The previous version is kept as LoginConfig.bak.
  • A broken file (ex. a typo while editing by hand) is kept as LoginConfig.json.broken, and LoginConfig.bak is used. If that is broken too, the file is created again with admin / 1234.
  • ExpiringWarnSeconds (almost expired event) can be changed only in the file.

Release History

Nov 12, 2026 - 1.1.0 ver<br> First Release Login<TLevel> with the account level of your own enum. One file LoginConfig.json (setting + accounts) in the executable folder, path change while running (SetFilePath), hide file option. Keep time per login (LogIn(id, pw, minutes), 5 / 10 / 30 / 60 / unlimited) and the last one remembered, RemainTime, Extend. Quick login and touch panel login. Password change is forced only at the first login of a newly created file. Consecutive login failures make the next login wait (1 s → 300 s). There is no permanent lock. 13 target frameworks (net45 ~ net481, net5.0, net8.0) without the System.Text.Json package.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 was computed.  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. 
.NET Framework net45 is compatible.  net451 is compatible.  net452 is compatible.  net46 is compatible.  net461 is compatible.  net462 is compatible.  net463 was computed.  net47 is compatible.  net471 is compatible.  net472 is compatible.  net48 is compatible.  net481 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.5.1

    • No dependencies.
  • .NETFramework 4.5.2

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETFramework 4.6.2

    • No dependencies.
  • .NETFramework 4.7

    • No dependencies.
  • .NETFramework 4.7.1

    • No dependencies.
  • .NETFramework 4.7.2

    • No dependencies.
  • .NETFramework 4.8

    • No dependencies.
  • .NETFramework 4.8.1

    • No dependencies.
  • net5.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Movensys.Login.Core:

Package Downloads
Movensys.Login.WinForms

Created by Movensys Application Team with login dialog, remain time view and account editor GUI functionality

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 48 11/24/2026