Configures passkey sign-in, two-factor authentication, and the user Security page in Orchard Core 4.0. Covers WebAuthn, passwordless login, recovery codes, and related features.
Ships in orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Configure passkey sign-in and two-factor authentication, and extend the user Security page.
OrchardCore.Users.Passkeys for passkeys; enable one or more two-factor methods (OrchardCore.Users.2FA.AuthenticatorApp, OrchardCore.Users.2FA.Email, OrchardCore.Users.2FA.Sms) for two-factor authentication. OrchardCore.Users.Security and OrchardCore.Users.2FA are enabled by dependency only.UserStore implements IUserPasskeyStore<IUser> whether or not the feature is enabled, so use the passkey methods of UserManager<IUser> instead of touching User.Passkeys directly./Security, user menu → Security). Add a section to it with a DisplayDriver<UserSecurity>; never add a separate page and user menu item.UserSecuritySettings.UseSiteTheme is on. TwoFactorLoginSettings.UseSiteTheme no longer exists.OrchardCore:Users:Passkeys:ServerDomain before users register passkeys on a site reached through several hosts; changing it later invalidates every registered passkey.internal sealed unless another assembly must reference the type.| Feature | ID | Depends on |
|---|---|---|
| User Security (enabled by dependency only) | OrchardCore.Users.Security | OrchardCore.Users |
| Two-Factor Authentication Services (enabled by dependency only) | OrchardCore.Users.2FA | OrchardCore.Users, OrchardCore.Users.Security |
| Two-Factor Authenticator App Method | OrchardCore.Users.2FA.AuthenticatorApp | OrchardCore.Users, OrchardCore.Users.2FA |
| Two-Factor Email Method | OrchardCore.Users.2FA.Email | OrchardCore.Users, OrchardCore.Users.2FA, OrchardCore.Liquid, OrchardCore.Email |
| Two-Factor SMS Method | OrchardCore.Users.2FA.Sms | OrchardCore.Users, OrchardCore.Users.2FA, OrchardCore.Liquid, OrchardCore.Sms |
| Passkeys | OrchardCore.Users.Passkeys | OrchardCore.Users, OrchardCore.Users.Security |
The constants are on OrchardCore.Users.UserConstants.Features (Passkeys, UserSecurity, TwoFactorAuthentication, AuthenticatorApp, EmailAuthenticator, SmsAuthenticator).
{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Users.Passkeys",
"OrchardCore.Users.2FA.AuthenticatorApp"
]
},
{
"name": "Settings",
"TwoFactorLoginSettings": {
"RequireTwoFactorAuthentication": false,
"AllowRememberClientTwoFactorAuthentication": true,
"NumberOfRecoveryCodesToGenerate": 5
},
"UserSecuritySettings": {
"UseSiteTheme": false
}
}
]
}
Both settings are edited in Settings → Security → User Login: TwoFactorLoginSettings on the Two-Factor Authentication tab, UserSecuritySettings (Use site theme for the security pages) on the Security Page tab. Both require ManageUsers. A role can also require two-factor authentication for its users (RoleLoginSettings).
OrchardCore.Users.Security maps SecurityController.Index to UserOptions.SecurityPath (default Security) for any authenticated user and adds the Security item to the user menu (UserMenuItems-Security shape, position Content:15 for Detail and DetailAdmin). The page builds the UserSecurity shape from IDisplayManager<UserSecurity>:
| Section | Shape | Location | Added by |
|---|---|---|---|
| Two-Factor Authentication (status, preferred method, methods, recovery codes) | UserSecurityTwoFactor | Content:5 | OrchardCore.Users.2FA |
| Passkeys (list, add, rename, remove) | UserSecurityPasskeys | Content:10 | OrchardCore.Users.Passkeys |
With no section the page shows "There are no security settings to manage." The former two-factor page path (UserOptions.TwoFactorAuthenticationPath, default TwoFactor) redirects to the Two-Factor Authentication section; the short-lived /Passkeys path was removed.
{
"OrchardCore": {
"Users": {
"SecurityPath": "Security",
"TwoFactorAuthenticationPath": "TwoFactor"
}
}
}
The page also renders in the site theme, which does not style the ocat-* classes, so section templates should space their content with Bootstrap utilities.
using OrchardCore.DisplayManagement.Handlers;
using OrchardCore.DisplayManagement.Views;
using OrchardCore.Users.Models;
namespace MyModule.Drivers;
internal sealed class SessionsUserSecurityDisplayDriver : DisplayDriver<UserSecurity>
{
public override IDisplayResult Display(UserSecurity model, BuildDisplayContext context)
{
if (model.User is not User user)
{
return null;
}
return Initialize<SessionsSecurityViewModel>("UserSecuritySessions", viewModel =>
{
viewModel.UserId = user.UserId;
}).Location("Content:20");
}
}
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Modules;
using OrchardCore.Users;
using OrchardCore.Users.Models;
namespace MyModule;
[RequireFeatures(UserConstants.Features.UserSecurity)]
public sealed class UserSecurityStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddDisplayDriver<UserSecurity, SessionsUserSecurityDisplayDriver>();
}
}
Views/UserSecuritySessions.cshtml renders a card-like section; post its forms to your own controller and redirect back to the UserSecurity route.
Enabling OrchardCore.Users.Passkeys lets users:
PasskeyService.MaxPasskeyCount = 100 per user, since they live in the user document).LoginFormPasskey shape added to the LoginForm) or by picking a passkey in the autofill of the username field, without typing a user name.UserConstants.PasskeyTwoFactorProvider = Passkey).UserVerificationRequirement of required, a passkey login counts as multi-factor (amr claims pop and mfa): users with two-factor enabled are not asked for a second factor, and users whose role requires two-factor are not forced to set up a method. Logging in with a password still asks for both.preferred or discouraged, a passkey is a single factor and users with two-factor enabled are asked for their second factor afterwards.The relying party ID defaults to the request host. Other options bind from OrchardCore:Users:Passkeys (values shown are the defaults):
{
"OrchardCore": {
"Users": {
"Passkeys": {
"ServerDomain": null,
"AuthenticatorTimeout": "00:05:00",
"ChallengeSize": 32,
"UserVerificationRequirement": "required",
"ResidentKeyRequirement": "preferred",
"AttestationConveyancePreference": null,
"AuthenticatorAttachment": null
}
}
}
}
| Option | Values |
|---|---|
ServerDomain | Common registrable domain when the site has several hosts (example.com for www.example.com and example.com). Changing it invalidates registered passkeys. |
AuthenticatorTimeout | How long the browser waits; the Identity.Passkey state cookie lives one minute longer. |
UserVerificationRequirement | required, preferred, discouraged. Only required (exact value) makes a passkey multi-factor. |
ResidentKeyRequirement | required, preferred, discouraged; discoverable passkeys allow login without a user name. |
AttestationConveyancePreference | none, indirect, direct, enterprise. |
AuthenticatorAttachment | platform or cross-platform; unset allows any authenticator. |
orchardcore-reverse-proxy).On Access Control → Users, a user who has passkeys gets a Remove passkeys item in the row's actions menu (UserPasskeyActionsMenu shape, ActionsMenu:11 in both SummaryAdmin and SummaryAdminGrid), shown to users who can EditUsers for that user. It asks through the confirm dialog, posts to AdminPasskeyController.RemoveAll, removes every passkey in one update, and disables two-factor when passkeys were the user's only method.
With OrchardCore.RateLimits enabled, POST Passkeys/Login (route name RateLimitRouteNames.PasskeyLogin) is limited to 10 requests per IP address with a sliding window, under the password-authentication policy shared with the login page (see orchardcore-rate-limits).
User.Passkeys is an IList<UserPasskey> (CredentialId, PublicKey, Name, CreatedUtc, LastUsedUtc, SignCount, Transports, IsUserVerified, IsBackupEligible, IsBackedUp, AttestationObject, ClientDataJson). It holds no secret.UserByPasskeyIndex (created by a migration of OrchardCore.Users) stores CredentialIdHash, a Base64Url SHA-256 of the credential id (UserByPasskeyIndex.HashCredentialId(byte[])), one record per passkey. UserManager.FindByPasskeyIdAsync() uses it so a passkey is registered only once.User.Passkeys.using Microsoft.AspNetCore.Identity;
using OrchardCore.Users;
public sealed class PasskeyReport
{
private readonly UserManager<IUser> _userManager;
public PasskeyReport(UserManager<IUser> userManager)
{
_userManager = userManager;
}
public async Task<int> CountAsync(IUser user)
=> (await _userManager.GetPasskeysAsync(user)).Count;
}
Views/TwoFactorAuthentication/Index.cshtml is now the UserSecurityTwoFactor shape: move an override to UserSecurityTwoFactor.cshtml.UserMenuItems-TwoFactor shape is replaced by UserMenuItems-Security; rename overrides.TwoFactorLoginSettings.UseSiteTheme moved to UserSecuritySettings.UseSiteTheme (a migration moves the stored value). Recipes must set it under UserSecuritySettings./TwoFactor keep working through the redirect; link to the UserSecurity route instead.UserSecurity prefix (fixed in 4.0, it failed to save before). Custom UserSecurityTwoFactor overrides must keep the field names the shape renders.| Symptom | Cause |
|---|---|
| No Log in with a passkey button | OrchardCore.Users.Passkeys disabled, or Disable local login is on. |
| Passkey refused after moving the site | The relying party ID (host or ServerDomain) changed; users must register new passkeys. |
| Passkey refused behind a proxy | Forwarded headers are off, so the scheme or host differs from the browser origin. |
| Users still asked for a second factor after a passkey login | UserVerificationRequirement is not exactly required. |
| Add passkey missing | Local login disabled and passkeys are not a two-factor method, or the user reached 100 passkeys. |
| Security page renders in the admin theme | Turn on Use site theme for the security pages (UserSecuritySettings.UseSiteTheme). |
orchardcore-users-roles for login, registration and role settings.orchardcore-rate-limits for the login policies.orchardcore-display-management for display drivers.What SKILL.md sets; muted values are Claude Code's defaults
/orchardcore:orchardcore-passkeysfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard.Other plugins' skills for the same job