Table of Contents

Class LoginModel

Namespace
Dynamicweb.CoreUI.Rendering.Models
Assembly
Dynamicweb.CoreUI.Rendering.dll

Represents the primary login model used for username-based authentication in the Core UI. Determines the appropriate form action based on configured LoginType.

public sealed class LoginModel : LoginModelBase
Inheritance
LoginModel
Inherited Members

Remarks

This model does not handle password submission directly. Use PasswordLoginModel for password-based flows. It also supports external (federated) authentication providers exposed via ExternalLogins.

Constructors

LoginModel()

Initializes a new instance of the LoginModel class and resolves the form action based on the global login type configuration.

public LoginModel()

Remarks

The login type is read from: /Globalsettings/Modules/Users/LogOn/Type. Falls back to Normal if the configured value is invalid.

LoginModel(string)

Initializes a new instance of the LoginModel class with an explicit form action.

public LoginModel(string formAction)

Parameters

formAction string

The target form action URL used for submission.

Properties

ExternalLogins

Gets the collection of configured external (third-party / federated) login providers available to the user.

public ICollection<ExternalLoginModel> ExternalLogins { get; }

Property Value

ICollection<ExternalLoginModel>

Remarks

Used to render alternative authentication options (e.g., OAuth providers).

RememberMe

Gets or sets a value indicating whether the authentication session should persist beyond the current browser session.

public bool RememberMe { get; set; }

Property Value

bool

Remarks

When RememberMe is set to true (checked) then the login cookie will be stored on the current device with an expiration based on the "Valid for" setting ("/Globalsettings/Modules/Users/AutoLoginCookie/ValideForDays") - or default to 30 days. When RememberMe is set to false (unchecked) then the login cookie will be stored for the current browser session only. The same "Valid for" setting for both frontend(Dynamicweb.Extranet cookie) and backend(Dynamicweb.Admin cookie).

Username

Gets or sets the username (or login identifier) provided by the user.

[Required]
public string? Username { get; set; }

Property Value

string

Remarks

This value is required and typically maps to either a username or email depending on system configuration.

To top