Configures and manages OpenID Connect in Orchard Core, covering authorization server, token validation, client integration, PKCE, client credentials, refresh tokens, and signing keys.
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 OrchardCore.OpenId module provides OpenID Connect and OAuth 2.0 on top of OpenIddict (7.8 in Orchard Core 4.0). Enable the features your scenario needs:
| Feature | ID | Purpose |
|---|---|---|
| OpenID Connect Core Services | OrchardCore.OpenId | Shared stores and managers. |
| OpenID Connect Management UI | OrchardCore.OpenId.Management | Applications and scopes admin. |
| OpenID Connect Authorization Server | OrchardCore.OpenId.Server | /connect/authorize, /connect/token, /connect/logout, /connect/userinfo, /connect/par, introspection, revocation. Depends on Management. |
| OpenID Connect Token Validation | OrchardCore.OpenId.Validation | Validates bearer tokens for the Api scheme (same tenant, another tenant, or a remote authority). |
| OpenID Connect Client Integration | OrchardCore.OpenId.Client | Sign in with an external OIDC provider. Depends on OrchardCore.Users.ExternalAuthentication. |
| OpenID Connect Secrets | OrchardCore.OpenId.Secrets | 4.0. Loads the server signing and encryption keys from the Secrets module. Depends on OrchardCore.OpenId.Server and OrchardCore.Secrets; must be enabled explicitly. |
Admin locations:
ManageServerSettings)ManageValidationSettings)ManageClientSettings)ManageApplications, ManageScopes)/connect/userinfo endpoint; enable OrchardCore.OpenId.Validation to accept its tokens on API endpoints.[Authorize(AuthenticationSchemes = OrchardCoreConstants.AuthenticationSchemes.Api)] (the "Api" scheme) rather than the raw OpenIddict scheme; the token's roles then drive Orchard permission checks.FindByPhysicalIdAsync on IOpenIdApplicationManager, IOpenIdAuthorizationManager or IOpenIdScopeManager, and by its OpenIddict id with FindByIdAsync. The authorization manager now really uses the store's physical-id lookup (it fell back to FindByIdAsync before #20381).{ "steps": [...] } format.sealed modifier, except View Models.The dedicated step toggles endpoints with Enable*Endpoint booleans (the paths are always /connect/*). It replaces the server settings: every flow or endpoint left out becomes false, while RequireEndSessionConfirmation defaults to true.
{
"steps": [
{
"name": "feature",
"enable": [
"OrchardCore.OpenId.Server",
"OrchardCore.OpenId.Validation"
]
},
{
"name": "OpenIdServerSettings",
"AccessTokenFormat": "JsonWebToken",
"Authority": "https://auth.example.com",
"EnableTokenEndpoint": true,
"EnableAuthorizationEndpoint": true,
"EnableLogoutEndpoint": true,
"EnableUserInfoEndpoint": true,
"EnablePushedAuthorizationEndpoint": true,
"EnableIntrospectionEndpoint": false,
"EnableRevocationEndpoint": false,
"AllowAuthorizationCodeFlow": true,
"AllowClientCredentialsFlow": true,
"AllowRefreshTokenFlow": true,
"AllowPasswordFlow": false,
"AllowImplicitFlow": false,
"AllowHybridFlow": false,
"DisableRollingRefreshTokens": false,
"RequireProofKeyForCodeExchange": true,
"RequirePushedAuthorizationRequests": false,
"RequireEndSessionConfirmation": true,
"UseReferenceAccessTokens": false
}
]
}
Other properties: DisableAccessTokenEncryption (lets third-party resource servers read JWTs), SigningCertificateStoreLocation/SigningCertificateStoreName/SigningCertificateThumbprint, and the matching EncryptionCertificate* properties. AccessTokenFormat is DataProtection (default) or JsonWebToken.
The generic settings step also accepts an OpenIdServerSettings object with the stored property names, including custom *EndpointPath values.
Enable OrchardCore.OpenId.Secrets to pick the server keys from the Secrets module in the Keys from secrets card of the server settings. The choice is stored in the OpenIdSecretSettings site settings (SigningKeySecretName, EncryptionKeySecretName), and each secret can be an RsaKeySecret with its private key (portable, tried first) or an X509Secret (certificate store reference or PEM certificate with private key). Secret keys are added before the configured or generated ones, so they are used first.
{
"steps": [
{
"name": "feature",
"enable": [ "OrchardCore.Secrets", "OrchardCore.OpenId.Server", "OrchardCore.OpenId.Secrets" ]
},
{
"name": "settings",
"OpenIdSecretSettings": {
"SigningKeySecretName": "OpenId.SigningKey",
"EncryptionKeySecretName": "OpenId.EncryptionKey"
}
}
]
}
Create the RSA or X.509 secrets first (admin or ISecretManager; the Secrets recipe step only creates text secrets). When the feature is enabled, a migration turns configured SigningCertificate*/EncryptionCertificate* settings into X509Secret references named OpenId.SigningCertificate and OpenId.EncryptionCertificate; certificates and private keys are not copied, so keep them accessible on every instance, and auto-generated development certificates are not converted. See orchardcore-secrets.
using OrchardCore.Data.Migration;
using OrchardCore.OpenId.Services;
namespace MyModule.Migrations;
public sealed class OpenIdServerMigrations : DataMigration
{
private readonly IOpenIdServerService _serverService;
public OpenIdServerMigrations(IOpenIdServerService serverService)
{
_serverService = serverService;
}
public async Task<int> CreateAsync()
{
var settings = await _serverService.LoadSettingsAsync();
settings.AllowAuthorizationCodeFlow = true;
settings.AllowClientCredentialsFlow = true;
settings.AllowRefreshTokenFlow = true;
settings.RequireProofKeyForCodeExchange = true;
settings.AuthorizationEndpointPath = "/connect/authorize";
settings.TokenEndpointPath = "/connect/token";
settings.LogoutEndpointPath = "/connect/logout";
settings.UserinfoEndpointPath = "/connect/userinfo";
settings.PushedAuthorizationEndpointPath = "/connect/par";
settings.RequireEndSessionConfirmation = true;
await _serverService.UpdateSettingsAsync(settings);
return 1;
}
}
Use LoadSettingsAsync() (not the cached GetSettingsAsync()) before updating. Validate with ValidateSettingsAsync(settings); for example, PAR requires the authorization endpoint, and the code flow requires both the authorization and token endpoints.
RequireEndSessionConfirmation (default true) shows a confirmation prompt on /connect/logout. Set it to false to sign users out immediately when the request carries a valid id_token_hint issued for the currently authenticated user; otherwise the prompt is still shown. When the prompt is skipped, the local authentication cookie is removed too. The setting is available in the admin, the OpenIdServerSettings recipe step, and deployment plans.
{
"steps": [
{
"name": "OpenIdServerSettings",
"EnableTokenEndpoint": true,
"EnableAuthorizationEndpoint": true,
"EnableLogoutEndpoint": true,
"EnableUserInfoEndpoint": true,
"AllowAuthorizationCodeFlow": true,
"AllowRefreshTokenFlow": true,
"RequireProofKeyForCodeExchange": true,
"RequireEndSessionConfirmation": false
}
]
}
When OrchardCore.RateLimits is enabled, the server registers a built-in limit on POST /connect/token (route Access.Token) for the password grant only: 100 requests per minute per IP, sliding window, sharing the password-authentication budget with the Users login form. Authorization code, refresh token, and client credentials requests are not limited, since a single server often requests tokens for many users. A rejected token request gets an OAuth 2.0 error response with error=slow_down and a Retry-After header (through a route rejection handler) instead of an empty body, so token clients can back off. See orchardcore-rate-limits.
ClientId. Confidential clients need a ClientSecret; public clients (SPAs, mobile) must not have one and should require PKCE.ConsentType is explicit, implicit, external, or systematic. Use implicit only for trusted first-party apps.RoleEntries; user-based flows get them from the user's roles through the roles scope.One application per step:
{
"steps": [
{
"name": "OpenIdApplication",
"ClientId": "spa-client",
"DisplayName": "Single Page Application",
"Type": "public",
"ConsentType": "implicit",
"AllowAuthorizationCodeFlow": true,
"AllowRefreshTokenFlow": true,
"AllowLogoutEndpoint": true,
"RequireProofKeyForCodeExchange": true,
"RedirectUris": "https://spa.example.com/callback https://spa.example.com/silent-renew",
"PostLogoutRedirectUris": "https://spa.example.com/logout-callback",
"ScopeEntries": [
{ "Name": "profile" },
{ "Name": "email" },
{ "Name": "roles" },
{ "Name": "api" }
]
},
{
"name": "OpenIdApplication",
"ClientId": "background-worker",
"DisplayName": "Background Worker",
"Type": "confidential",
"ClientSecret": "{{WorkerSecret}}",
"AllowClientCredentialsFlow": true,
"RoleEntries": [
{ "Name": "Editor" }
],
"ScopeEntries": [
{ "Name": "api" }
]
}
]
}
Other flags: AllowPasswordFlow, AllowHybridFlow, AllowImplicitFlow, AllowIntrospectionEndpoint, AllowRevocationEndpoint, RequirePushedAuthorizationRequests. The openid scope does not need a scope entry. A recipe run for an existing ClientId updates that application.
using OpenIddict.Abstractions;
using OrchardCore.Data.Migration;
using OrchardCore.OpenId.Abstractions.Descriptors;
using OrchardCore.OpenId.Abstractions.Managers;
namespace MyModule.Migrations;
public sealed class OpenIdClientMigrations : DataMigration
{
private readonly IOpenIdApplicationManager _applicationManager;
public OpenIdClientMigrations(IOpenIdApplicationManager applicationManager)
{
_applicationManager = applicationManager;
}
public async Task<int> CreateAsync()
{
await _applicationManager.CreateAsync(new OpenIdApplicationDescriptor
{
ClientId = "my-web-app",
DisplayName = "My Web Application",
ClientSecret = "your-client-secret-here",
ClientType = OpenIddictConstants.ClientTypes.Confidential,
ConsentType = OpenIddictConstants.ConsentTypes.Implicit,
Permissions =
{
OpenIddictConstants.Permissions.Endpoints.Authorization,
OpenIddictConstants.Permissions.Endpoints.Token,
OpenIddictConstants.Permissions.Endpoints.EndSession,
OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode,
OpenIddictConstants.Permissions.GrantTypes.RefreshToken,
OpenIddictConstants.Permissions.ResponseTypes.Code,
OpenIddictConstants.Permissions.Scopes.Email,
OpenIddictConstants.Permissions.Scopes.Profile,
OpenIddictConstants.Permissions.Scopes.Roles,
OpenIddictConstants.Permissions.Prefixes.Scope + "api",
},
Requirements =
{
OpenIddictConstants.Requirements.Features.ProofKeyForCodeExchange,
},
RedirectUris = { new Uri("https://myapp.example.com/signin-oidc") },
PostLogoutRedirectUris = { new Uri("https://myapp.example.com/signout-callback-oidc") },
});
return 1;
}
}
Prefer a recipe for secrets that differ per environment, and never commit real secrets.
| Flow | Server setting | Client requirements |
|---|---|---|
| Authorization code (+ PKCE) | AllowAuthorizationCodeFlow | GrantTypes.AuthorizationCode, ResponseTypes.Code; public clients require PKCE. |
| Client credentials | AllowClientCredentialsFlow | Confidential client with GrantTypes.ClientCredentials; roles from RoleEntries. |
| Refresh token | AllowRefreshTokenFlow | GrantTypes.RefreshToken; rolling refresh tokens unless DisableRollingRefreshTokens. |
| Pushed authorization requests | EnablePushedAuthorizationEndpoint (/connect/par) | Application RequirePushedAuthorizationRequests to enforce. |
| Implicit / hybrid / password | AllowImplicitFlow, AllowHybridFlow, AllowPasswordFlow | Legacy only. |
{
"steps": [
{
"name": "OpenIdScope",
"ScopeName": "api",
"DisplayName": "API Access",
"Description": "Grants access to protected API endpoints.",
"Resources": "my-resource-server"
}
]
}
Resources is space-separated and becomes the token audience. In the admin, a scope can also target tenants, which builds oct:{TenantName} audiences for cross-tenant validation.
openid — required; returns sub.profile — profile claims.email — email and email_verified.phone — phone number claims.roles — role claims; needed for Orchard permission checks on API calls.using OrchardCore.OpenId.Abstractions.Handlers;
namespace MyModule.Services;
public sealed class TenantUserInfoClaimsProvider : IUserInfoClaimsProvider
{
public Task GenerateAsync(UserInfoClaimsContext context)
{
context.Claims["tenant"] = "example";
return Task.CompletedTask;
}
}
Register with services.AddScoped<IUserInfoClaimsProvider, TenantUserInfoClaimsProvider>();. Standard scope claims are already written when GenerateAsync runs; inspect context.Principal for the user.
Set exactly one of Tenant (validate tokens issued by an authorization server tenant in the same app) or Authority (remote server with discovery). With neither, the settings are invalid and every bearer call returns 401.
{
"steps": [
{
"name": "OpenIdValidationSettings",
"Tenant": "Default"
}
]
}
{
"steps": [
{
"name": "OpenIdValidationSettings",
"Authority": "https://idp.example.com",
"Audience": "my-resource-server",
"MetadataAddress": "",
"DisableTokenTypeValidation": false
}
]
}
using System.Security.Claims;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using OrchardCore;
using OrchardCore.Contents;
namespace MyModule.Controllers;
[ApiController]
[Route("api/products")]
[Authorize(AuthenticationSchemes = OrchardCoreConstants.AuthenticationSchemes.Api)]
public sealed class ProductsController : ControllerBase
{
private readonly IAuthorizationService _authorizationService;
public ProductsController(IAuthorizationService authorizationService)
{
_authorizationService = authorizationService;
}
[HttpGet]
public async Task<IActionResult> GetAll()
{
if (!await _authorizationService.AuthorizeAsync(User, CommonPermissions.ViewContent))
{
return this.ApiForbidProblem();
}
return Ok(new { UserId = User.FindFirstValue(ClaimTypes.NameIdentifier) });
}
}
401 with the RFC 6750 WWW-Authenticate header from OpenIddict and, in 4.0, an RFC 9457 Problem Details body written by the Api scheme's middleware through IProblemDetailsService. Insufficient permissions return 403 with Problem Details. The OAuth 2.0 error details stay in the WWW-Authenticate header; the body doesn't repeat them as error/error_uri extensions.DisableAntiforgery() / [IgnoreAntiforgeryToken] is appropriate only on bearer-authenticated endpoints.The OrchardCore.OpenId.Client feature signs users in with an external provider and links or registers local users (an email claim links to an existing account after authentication).
{
"steps": [
{
"name": "OpenIdClientSettings",
"DisplayName": "Corporate IdP",
"Authority": "https://login.microsoftonline.com/{tenant-id}/v2.0",
"ClientId": "azure-app-client-id",
"ClientSecret": "azure-app-client-secret",
"CallbackPath": "/signin-oidc",
"SignedOutCallbackPath": "/signout-callback-oidc",
"SignedOutRedirectUri": "https://www.example.com/",
"ResponseType": "code",
"ResponseMode": "form_post",
"Scopes": "email profile",
"StoreExternalTokens": false
}
]
}
Scopes is a space- or comma-separated string of extra scopes.
In 4.0, OpenIdClientSettings.ClientSecretSecretName can name a TextSecret of the Secrets module; it takes precedence over ClientSecret. With OrchardCore.Secrets enabled, the Authentication Client settings offer Use a secret (suggested name OpenIdClient.ClientSecret), and a saved client secret can be moved without retyping it from Tools → Security → Migrate Secrets. The OpenIdClientSettings step has no secret-name property and leaves an existing reference unchanged; set it in the admin or with the generic settings step. See orchardcore-secrets.
For Microsoft Entra ID, Google, GitHub, Facebook, or X, prefer the dedicated modules (orchardcore-microsoft-auth, orchardcore-google, orchardcore-github-authentication, orchardcore-facebook, orchardcore-twitter).
OrchardCore.OpenId.Permissions.ManageApplications, ManageClientSettings, ManageScopes, ManageServerSettings, and ManageValidationSettings were removed; use the same members on OrchardCore.OpenId.OpenIdPermissions.RequireEndSessionConfirmation now really skips the prompt for a valid id_token_hint (the prompt was always shown in 3.x). It can now be set from the OpenIdServerSettings step and is exported by deployment plans; omitted, it is true.UseRollingRefreshTokens, *EndpointPath in the OpenIdServerSettings step, ClientType or AllowedScopes in OpenIdApplication) must use DisableRollingRefreshTokens, Enable*Endpoint, Type, and ScopeEntries.401/403 challenges now carry a Problem Details body; the status codes and WWW-Authenticate header are unchanged. The Token Validation feature no longer registers its own OpenIddict challenge handler or calls AddProblemDetails() (the host registers Problem Details), so customize the body through IProblemDetailsService.POST /connect/token are limited per IP and rejected with an OAuth 2.0 slow_down error and Retry-After.OpenIdClientSettings gains ClientSecretSecretName, and the optional OrchardCore.OpenId.Secrets feature, part of the OrchardCore.OpenId module (no separate package), loads server keys from secrets.See openid-examples.md for complete setups.
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-openidfrom 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