Configures ABP's OpenIddict auth server: token lifetimes, refresh tokens, PKCE, HTTPS requirement, and production certificates.
Ships in abp-authentication. 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.
ABP's OpenIddict module wraps OpenIddict to provide the OAuth 2.0 / OpenID Connect auth server (single sign-on, single log-out, API access control). Applications, scopes, authorizations and tokens are persisted to the database.
AbpOpenIddictAspNetCoreModule registers the server for you: it calls services.AddOpenIddict().AddServer(...), enables the standard flows (authorization code, hybrid, implicit, password, client credentials, refresh token, device, none, token exchange), registers the standard scopes (openid, email, profile, phone, roles, address, offline_access), and enables ASP.NET Core pass-through for the connect/* endpoints. You customize it through PreConfigure<...> and Configure<...>.
The framework enabling a flow doesn't mean a new client should use it: for new clients prefer authorization code + PKCE (web / SPA / mobile) or client credentials (server-to-server), and treat implicit and password (ROPC) as legacy — enable them only for existing clients that still require them.
refresh_token grant + offline_access scope).Builder configuration (OpenIddictServerBuilder, OpenIddictValidationBuilder, AbpOpenIddictAspNetCoreOptions) goes in PreConfigureServices. TokenCleanupOptions and runtime options like OpenIddictServerAspNetCoreOptions go in ConfigureServices. Put this in your AuthServerModule (or HttpApiHostModule if you don't have a separate auth server).
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<OpenIddictServerBuilder>(builder =>
{
// server-side configuration
});
}
Configure lifetimes on the OpenIddictServerBuilder:
PreConfigure<OpenIddictServerBuilder>(builder =>
{
builder.SetAuthorizationCodeLifetime(TimeSpan.FromMinutes(30));
builder.SetAccessTokenLifetime(TimeSpan.FromMinutes(30));
builder.SetIdentityTokenLifetime(TimeSpan.FromMinutes(30));
builder.SetRefreshTokenLifetime(TimeSpan.FromDays(14));
});
Two things are required:
refresh_token grant type. In the OpenIddictDataSeedContributor, add OpenIddictConstants.GrantTypes.RefreshToken to the grantTypes list in the CreateApplicationAsync call. If the database is already seeded, re-create the client.offline_access scope:
options.Scope.Add("offline_access"); in the OpenIdConnect options.options.ProviderOptions.DefaultScopes.Add("offline_access"); in AddOidcAuthentication.offline_access to the oAuthConfig scopes in environment.ts (already configured in the template).Keep the cookie ExpireTimeSpan roughly aligned with the refresh token lifetime. If the cookie outlives the refresh token, the user still appears signed in locally (the cookie session stays valid) but can no longer silently obtain a fresh access_token once the refresh token expires — so their API calls start failing. Aligning the two makes the local session and token refresh expire together; it does not make an expired token valid.
PKCE is standard OpenIddict configuration. See the OpenIddict docs: https://documentation.openiddict.com/configuration/proof-key-for-code-exchange.html
By default OpenIddict requires HTTPS on all endpoints. To allow HTTP locally, configure OpenIddictServerAspNetCoreOptions in ConfigureServices (only do this in development):
Configure<OpenIddictServerAspNetCoreOptions>(options =>
{
options.DisableTransportSecurityRequirement = true;
});
AbpOpenIddictAspNetCoreOptions.AddDevelopmentEncryptionAndSigningCertificate defaults to true. When it is on, the module calls builder.AddDevelopmentEncryptionCertificate() and builder.AddDevelopmentSigningCertificate() — user-specific certificates suitable for development only.
For non-development environments you must turn this off and register your own certificates:
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
{
options.AddDevelopmentEncryptionAndSigningCertificate = false;
});
var configuration = context.Services.GetConfiguration();
PreConfigure<OpenIddictServerBuilder>(builder =>
{
// Read the certificate path/password from configuration or a secret store — don't hardcode the password
builder.AddProductionEncryptionAndSigningCertificate(
configuration["OpenIddict:CertificatePath"],
configuration["OpenIddict:CertificatePassword"]);
});
Don't hardcode the .pfx password (or check the certificate into source control) — read it from configuration, an environment variable, or a secret store, and keep the certificate out of the repository.
Notes:
AddDevelopmentEncryptionAndSigningCertificate cannot be used on IIS or Azure App Service unless the app pool loads a user profile — it throws at runtime otherwise. Use real certificates stored in the machine's X.509 store instead. See https://documentation.openiddict.com/configuration/encryption-and-signing-credentials.htmlAddProductionEncryptionAndSigningCertificate is an ABP extension method (OpenIddictServerBuilderExtensions in Volo.Abp.OpenIddict.AspNetCore): it loads a .pfx and registers it as both the signing and encryption certificate. AddSigningCertificate and AddEncryptionCertificate are the underlying OpenIddict calls; consult the OpenIddict docs for the overload you need.ABP calls builder.DisableAccessTokenEncryption() by default (for compatibility — access tokens are readable JWTs). To re-enable encryption:
PreConfigure<OpenIddictServerBuilder>(builder =>
{
builder.Configure(options => options.DisableAccessTokenEncryption = false);
});
AbpOpenIddictAspNetCoreOptions.UpdateAbpClaimTypes (default true): maps AbpClaimTypes (UserId, Role, UserName, Email, etc.) onto the OpenIddict claim types (sub, role, preferred_username, ...). Set false only if you deliberately manage claim types yourself.TokenCleanupOptions (in ConfigureServices): controls the background job that prunes orphaned tokens/authorizations — IsCleanupEnabled (default true), CleanupPeriod (default 3,600,000 ms), MinimumTokenLifespan / MinimumAuthorizationLifespan (default 14 days).access_token and/or id_token, implement IAbpOpenIddictClaimsPrincipalHandler (call claim.SetDestinations(...)) and register it via AbpOpenIddictClaimsPrincipalOptions.ClaimsPrincipalHandlers.Add<...>().PreConfigure/Configure wiring.refresh_token + requesting offline_access, confirm the token response includes a refresh_token and that exchanging it returns a new access_token.DisableTransportSecurityRequirement = true, confirm the connect/* endpoints respond over plain HTTP locally..pfx (and that it does not fall back to development certificates).access_token — readable JWT when encryption is disabled (default), opaque when re-enabled.ExpireTimeSpan outlives the refresh token leaves the user with a valid local session but no way to silently refresh the access_token, so API calls start failing — keep the cookie lifetime and refresh-token lifetime aligned (it does not keep an expired token valid).refresh_token grant on the client and the offline_access scope on the request; missing either silently yields no refresh token. If the DB is already seeded, re-create the client after changing grant types.AddDevelopmentEncryptionAndSigningCertificate throws at runtime on IIS / Azure App Service unless the app pool loads a user profile — use real X.509 certificates there.AddDevelopmentEncryptionAndSigningCertificate = false and register production certificates for non-dev environments.https://github.com/abpframework/abp/blob/rel-10.5/docs/en/modules/openiddict.mdhttps://github.com/abpframework/abp/blob/rel-10.5/modules/openiddict/src/Volo.Abp.OpenIddict.AspNetCore/Volo/Abp/OpenIddict/AbpOpenIddictAspNetCoreModule.csWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/abp-authentication:configure-openiddict-authenticationfrom abp-authentication
npx claudepluginhub abpframework/abp-skills --plugin abp-authentication3 skills in this plugin
/configure-dynamic-claimsRefresh a user's claims (roles, profile claims, and custom claims added to DynamicClaims) mid-session without re-login — enabling ABP dynamic claims, wiring the middleware, and adding a custom claims contributor in monolith or tiered/microservice setups. (Permissions are not part of the default dynamic-claims set.) USE FOR: IsDynamicClaimsEnabled on AbpClaimsPrincipalFactoryOptions, UseDynamicClaims middleware, RemoteRefreshUrl in tiered apps, IAbpDynamicClaimsPrincipalContributor, IsRemoteRefreshEnabled / WebRemoteDynamicClaimsPrincipalContributorOptions, choosing which DynamicClaims types refresh. DO NOT USE FOR: configuring the auth server itself (token lifetimes, certificates, refresh tokens) — use the configure-openiddict-authentication skill; defining/checking permissions — use the permissions-and-authorization skill; per-entity resource access — use the authorize-resources skill.
/configure-openiddict-validationConfigure the ABP OpenIddict validation (resource-server / API token-validation) side — how an API host validates incoming access tokens, distinct from the auth server that issues them. USE FOR: PreConfigure the OpenIddict builder then .AddValidation(...), or PreConfigure the OpenIddictValidationBuilder, options.AddAudiences, options.UseLocalServer (same-process auth server) vs a remote issuer (options.SetIssuer / AddAbpJwtBearer Authority+Audience), options.UseAspNetCore, ForwardIdentityAuthenticationForBearer, app.UseAbpOpenIddictValidation, introspection (UseIntrospection / SetClientId / SetClientSecret), EnableTokenEntryValidation. DO NOT USE FOR: issuing tokens / configuring the OpenIddict server, token lifetimes, signing/encryption certificates — use configure-openiddict-authentication; refreshing role/profile/custom claims mid-session — use configure-dynamic-claims; Swagger OAuth wiring — use configure-swagger-openapi.
Other plugins' skills for the same job