Covers the Orchard Core 4.0 Secrets module for managing passwords, API keys, certificates, and other credentials via the Database or Azure Key Vault stores. Includes ISecretManager, secret types, migration, and deployment steps.
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.
Read when SKILL.md points to them.
The Secrets module (new in 4.0) keeps passwords, API keys, connection strings, RSA keys, and certificates in one place, encrypted with ASP.NET Core Data Protection or stored in Azure Key Vault. Built-in features can reference a secret by name instead of keeping their own protected copy of a credential.
| Feature ID | Name | Notes |
|---|---|---|
OrchardCore.Secrets | Secrets | Admin screens, the Database store, the three secret types, recipe and deployment steps. Category Security. |
OrchardCore.Secrets.AzureKeyVault | Secrets - Azure Key Vault | Adds the AzureKeyVault store. Depends on OrchardCore.Secrets. |
OrchardCore.OpenId.Secrets | OpenID Connect Secrets | In the OrchardCore.OpenId module. Loads the OpenID server signing and encryption keys from secrets. Depends on OrchardCore.OpenId.Server and OrchardCore.Secrets. |
Both Secrets modules ship in OrchardCore.Application.Cms.Targets. A module
that only consumes or edits credentials references OrchardCore.Secrets.Abstractions
and does not declare a dependency on the OrchardCore.Secrets feature.
<PackageReference Include="OrchardCore.Secrets.Abstractions" Version="4.*" />
Admin screens are under Tools → Security: Secrets, Migrate Secrets, and Secret Stores.
Smtp.Password or
Payment.ApiKey. Names can't be changed after creation; settings reference
them by name.*SecretName property, a recipe, or a
deployment plan. Supply recipe values from configuration
(OrchardCore:Secrets:{Name}) or use an encrypted export.orchardcore-azure-data-protection). The Database store can't decrypt
secrets without the original keys.ViewSecrets see a dashboard warning for secrets expired or expiring within 30 days.ISecretManager, ISecretStore, ISecretTypeProvider,
ISecretStoreOperations) are tenant singletons. Custom stores must be
thread-safe and must not depend on scoped services.using OrchardCore.Secrets;
namespace MyModule.Services;
public sealed class PaymentGatewayClient
{
private readonly ISecretManager _secretManager;
public PaymentGatewayClient(ISecretManager secretManager)
{
_secretManager = secretManager;
}
public async Task<string> GetApiKeyAsync()
{
var secret = await _secretManager.GetSecretAsync<TextSecret>("Payment.ApiKey");
return secret?.Text;
}
public Task SaveApiKeyAsync(string apiKey)
=> _secretManager.SaveSecretAsync(
"Payment.ApiKey",
new TextSecret { Text = apiKey },
"Database",
new SecretSaveOptions { Description = "Payment gateway API key" });
}
ISecretManager members: GetSecretAsync(name) and GetSecretAsync(name, storeName)
(return a Secret), SaveSecretAsync(name, secret, options) and
SaveSecretAsync(name, secret, storeName, options) (take a Secret),
RemoveSecretAsync(name) and RemoveSecretAsync(name, storeName),
GetSecretInfosAsync() (metadata only, as SecretInfo), and GetStores().
GetSecretAsync<T>(name) and GetSecretAsync<T>(name, storeName) are extension
methods (SecretManagerExtensions, and SecretStoreExtensions for a store) that
return the secret only when it is a T, otherwise null.
SecretSaveOptions carries Description and ExpiresUtc.
Secret UnionSecrets are exchanged as Secret, a C# union (.NET 11) of a closed set of types:
public union Secret(TextSecret, RsaKeySecret, X509Secret). There is no ISecret
marker interface anymore. A TextSecret, RsaKeySecret or X509Secret
converts implicitly to a Secret, so SaveSecretAsync("Name", new TextSecret { ... })
compiles as is. To handle every type, switch on the Secret; the compiler checks
that the switch is exhaustive. A secret that is not found has a null Value and
matches the null pattern:
var secret = await _secretManager.GetSecretAsync("Signing.Key");
using var rsa = secret switch
{
RsaKeySecret rsaKey => CreateRsa(rsaKey),
X509Secret x509 => x509.GetCertificate()?.GetRSAPrivateKey(),
TextSecret => throw new InvalidOperationException("The secret is not a key."),
null => throw new InvalidOperationException("The secret was not found."),
};
Secret.Types lists the three types, Secret.FromValue(object) wraps an instance
(and throws for any other type), and Secret.TryGetType(name, out type) resolves a
type from its name, which a store uses to restore what it persisted. Secret has
the same name as Microsoft.AspNetCore.DataProtection.Secret: in a file importing
both namespaces, add using Secret = OrchardCore.Secrets.Secret;.
| Type | Members | Use |
|---|---|---|
TextSecret | Text | Passwords, API keys, connection strings, client secrets. The only type that settings and the Migrate Secrets screen use. |
RsaKeySecret | PublicKey, PrivateKey (Base64), IncludesPrivateKey, KeySize (2048) | Portable signing keys, encrypted deployment exports. Can be generated in the admin. |
X509Secret | Source (X509SecretSource.Store or Pem), StoreLocation, StoreName, Thumbprint, CertificatePem, PrivateKeyPem, FromPem(), GetCertificate() | A reference to the OS certificate store, or a PEM certificate plus an unencrypted PKCS#8, RSA, or EC private key (no certificate store needed, e.g. Linux or shared hosting). |
| Store name | Feature | Notes |
|---|---|---|
Database | OrchardCore.Secrets | Default. Values encrypted with Data Protection in the tenant database. Not separately disableable. |
AzureKeyVault | OrchardCore.Secrets.AzureKeyVault | Uses a host-registered keyed SecretClient; names are namespaced by prefix, tenant, and a hash. Deletion is a soft delete, never a purge. |
Add a store with services.AddSecretStore<TStore>() (implement ISecretStore:
Name, IsReadOnly, Task<Secret> GetSecretAsync(name) returning default when
not found, SaveSecretAsync(name, Secret secret, options), RemoveSecretAsync,
GetSecretInfosAsync). The secret types are the closed set of the Secret union:
a module can't add its own secret type (Secret.FromValue rejects other types);
store a JSON payload in a TextSecret instead. See
references/secrets-examples.md for the Key
Vault configuration and a custom store.
The pattern that the built-in integrations use, without depending on the Secrets feature:
{Property}SecretName
property next to it. The secret takes precedence when set.SecretInputViewModel in the editor model, build it with
SecretInputViewModel.Create(protectedValue, secretName), and apply posted
values with await model.ApiKey.UpdateAsync(new SecretInputUpdateContext(...));
store ProtectedValue and SecretName only when the result Succeeded.@addTagHelper *, OrchardCore.Secrets.Abstractions and render
<secret-input asp-for="ApiKey" secret-name="MyService.ApiKey" />.
Without the Secrets feature it is a password box; with it, the user picks
User-specified value or Use a secret (with New secret and a reload button).await serviceProvider.GetSecretValueAsync(secretName, protectedValue, protector, logger).
It reads the secret when the feature is enabled, otherwise decrypts the
protected value, and returns null (with a log entry, never the value) when neither works.DisplayDriver<SecretMigration> registered in a
[RequireFeatures("OrchardCore.Secrets")] startup, calling
migration.MoveToSecretAsync(...).Keep the Data Protection purpose (protector name) unchanged forever. A full driver, view, runtime read, and migration driver are in references/secrets-examples.md.
When a setting must always reference a secret of a given type, render the
SelectSecret view component (selectedSecret, htmlId, htmlName,
secretTypes, required, cssClass); the feature that renders it must depend
on OrchardCore.Secrets.
| Integration | Settings class | Credential | Secret reference | Suggested secret name |
|---|---|---|---|---|
| SMTP email | SmtpSettings | Password | PasswordSecretName | Smtp.Password |
| Azure email | AzureEmailSettings | ConnectionString | ConnectionStringSecretName | AzureEmail.ConnectionString |
| Twilio SMS | TwilioSettings | AuthToken | AuthTokenSecretName | Twilio.AuthToken |
| Azure SMS | AzureSmsSettings | ConnectionString | ConnectionStringSecretName | AzureSms.ConnectionString |
FacebookSettings | AppSecret | AppSecretSecretName | Facebook.AppSecret | |
| GitHub authentication | GitHubAuthenticationSettings | ClientSecret | ClientSecretSecretName | GitHub.ClientSecret |
| Google authentication | GoogleAuthenticationSettings | ClientSecret | ClientSecretSecretName | Google.ClientSecret |
| Microsoft Account | MicrosoftAccountSettings | AppSecret | AppSecretSecretName | MicrosoftAccount.AppSecret |
| X (Twitter) | TwitterSettings | ConsumerSecret, AccessTokenSecret | ConsumerSecretSecretName, AccessTokenSecretSecretName | Twitter.ConsumerSecret, Twitter.AccessTokenSecret |
| OpenID Connect client | OpenIdClientSettings | ClientSecret | ClientSecretSecretName | OpenIdClient.ClientSecret |
| Azure AI Search | AzureAISearchDefaultSettings | ApiKey | ApiKeySecretName | AzureAISearch.ApiKey |
| OpenID server keys | OpenIdSecretSettings | signing and encryption keys | SigningKeySecretName, EncryptionKeySecretName | OpenId.SigningCertificate, OpenId.EncryptionCertificate |
Only TextSecret values are selectable for these credentials, except the
OpenID server keys, which accept an RsaKeySecret (tried first) or an X509Secret.
The Secrets step creates TextSecret entries. With an array, each entry
takes Name, an optional Store, and an optional Value; without Value,
the value is read from configuration key OrchardCore:Secrets:{Name}
(environment variable OrchardCore__Secrets__Smtp.Password; the dot in the
name is kept). Entries without a value are skipped with a warning.
{
"steps": [
{
"name": "Feature",
"enable": [ "OrchardCore.Secrets", "OrchardCore.Email.Smtp" ]
},
{
"name": "Secrets",
"Secrets": [
{ "Name": "Smtp.Password", "Store": "Database" }
]
},
{
"name": "Settings",
"SmtpSettings": {
"IsEnabled": true,
"DefaultSender": "[email protected]",
"Host": "smtp.example.com",
"Port": 587,
"EncryptionMethod": "StartTls",
"RequireCredentials": true,
"UserName": "smtp-user",
"PasswordSecretName": "Smtp.Password",
"DeliveryMethod": "Network"
}
}
]
}
The Settings step replaces the whole settings object, so list every property
you need. Don't put a value into Value in a committed recipe.
The Secrets deployment step exports the metadata of every secret
(Store, Type, Description, ExpiresUtc) under an object keyed by name,
without values; on import, values come from OrchardCore:Secrets:{Name}.
Selecting an Encryption key (EncryptionKeyName, an RsaKeySecret or
RSA X509Secret) exports values encrypted with RSA-OAEP-SHA256 plus AES-GCM,
authenticated with their metadata. The source holds only the destination's
public key under the same logical name; the destination holds the private key
before import. The key secret itself is never exported. See
references/secrets-examples.md for both
formats and the key setup.
TextSecret in the chosen
store, sets the *SecretName reference, and clears the old property only
after the secret is persisted. Existing secrets are never overwritten;
failures are reported and leave settings unchanged. Users must manage both
the secrets and that feature's settings.ISecretStoreOperations.MoveSecretAsync(name, source, destination)
and MoveAllSecretsAsync(source, destination); results are
SecretStoreOperationResult (Succeeded, DestinationSaved, Failure).Configuration credentials (appsettings.json, environment variables) keep
working in 4.0 but log a warning with event 8100, name
LegacySecretConfiguration, category OrchardCore.Secrets.Configuration. It
names the tenant, integration, and key, never the value, and also fires when
a configuration credential remains next to a selected secret. Keys checked:
Authentication:GitHub:ClientSecret, Facebook:AppSecret,
Authentication:Google:ClientSecret, Authentication:MicrosoftAccount:AppSecret,
X:ConsumerSecret, X:AccessTokenSecret, Email:Smtp:Password,
Email:Azure:ConnectionString, Sms:Azure:ConnectionString, and
Search:AzureAISearch:Credential:Key (all under OrchardCore, plus their
legacy section aliases).
To retire them: create the secret, select it in the integration's settings
screen (the configuration-only default SMTP, Azure email, and Azure SMS
providers have no secret reference, so switch to their tenant provider),
verify the service, remove the configuration
value from every source, restart, activate each tenant, exercise each
integration, and search the logs for LegacySecretConfiguration again.
Options initialize lazily, so also audit configuration sources directly.
Custom integrations can emit the same warning with
section.WarnIfLegacySecretConfigured(logger, tenantName, integration, keys).
| Permission | Grants |
|---|---|
SecretsPermissions.ManageSecrets | Create, edit, move, and delete secrets. Administrator stereotype. |
SecretsPermissions.ViewSecrets | List secret metadata, never values. Implied by ManageSecrets. |
Secret values are never sent back to the browser; leave the value empty when editing to keep it.
OrchardCore.OpenId.Secrets creates X509Secret references named
OpenId.SigningCertificate and OpenId.EncryptionCertificate for configured
server certificates; it doesn't copy certificates or private keys, and
auto-generated development certificates are not converted.*SecretName (use GetSecretValueAsync() or the integration's runtime
options); a moved credential's protected property is empty.AzureKeyVault store is missing from the store list: its configuration
is missing or invalid (see the log error naming the feature and tenant). The
tenant keeps running and secrets are saved to Database; fix
OrchardCore:Secrets:AzureKeyVault and restart.Official Orchard Core videos shown on the documentation page:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/orchardcore:orchardcore-secretsfrom 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