Class ExternalLoginViewModel
- Namespace
- Dynamicweb.Users.Frontend.UserAuthentication
- Assembly
- Dynamicweb.Users.dll
Represents an external login provider available in the authentication flow.
public sealed class ExternalLoginViewModel : ViewModelBase
- Inheritance
-
ExternalLoginViewModel
- Inherited Members
Examples
Razor template usage:
@inherits ViewModelTemplate<Dynamicweb.Users.Frontend.UserAuthentication.UserAuthenticationViewModel> @using Dynamicweb.Users.Frontend.UserAuthentication
@if (Model.ExternalLogins?.Any() == true) { <ul class="external-logins"> @foreach (var provider in Model.ExternalLogins) { <li> <button type="submit" name="ExternalLoginProviderId" value="@provider.Id"> @if (!string.IsNullOrEmpty(provider.Icon)) { <img src="@provider.Icon" alt="" /> } <span>@provider.Name</span> </button> </li> } </ul> }
Remarks
Instances of this model are exposed via ExternalLogins. They describe a single external identity provider (e.g., Google, Azure AD, Facebook).
Templates typically iterate over this collection to render external login buttons or links alongside the regular login form.
Properties
Icon
Gets the optional icon URL for the provider (e.g., a logo image).
If present, templates can render it next to the provider name.
public string? Icon { get; init; }
Property Value
Id
Gets the numeric identifier of the external login provider.
This value is posted back to the server when a user selects this provider.
public int Id { get; init; }
Property Value
Name
Gets the display name of the external provider (e.g., “Google”, “Azure AD”).
This value is required and should be shown in the UI.
public required string Name { get; init; }