Install
openclaw skills install oidc-integrationPlan and implement OIDC and OAuth 2.0 integration for React or TypeScript frontends and Java or Spring Boot backends. Use whenever the user mentions OIDC, OpenID Connect, OAuth login, SSO, PKCE, authorization code flow, refresh tokens, JWT or JWKS validation, login callback pages, protected routes, Keycloak, Auth0, IdentityServer, Authing, multi-provider auth, or "add login" and "integrate IdP" style requests even if they do not explicitly say OIDC.
openclaw skills install oidc-integrationUse this skill to design or implement authentication flows that rely on an OpenID Connect provider.
Help the user integrate OIDC in a way that matches their architecture, avoids unsafe defaults, and produces code that fits the current stack instead of dumping generic samples.
Start by identifying the actual integration shape before writing code.
Check these points first:
If the user only needs one layer, stay scoped to that layer. Do not generate both frontend and backend integration unless the task actually spans both.
Apply these defaults unless the user explicitly needs something different:
/.well-known/openid-configuration over hardcoding endpoints.localStorage.offline_access only when refresh tokens are actually needed.iss, aud, signature, expiry, and key rotation behavior.Do not normalize insecure shortcuts as the default recommendation.
Prefer framework-native or well-supported libraries before hand-rolled auth code.
If the user asks for concrete implementation examples, read only the relevant reference file instead of expanding the main skill body:
references/react-spa.md for React or TypeScript SPA login, callback, guards, and API calls.references/spring-resource-server.md for Spring Boot bearer-token validation and route protection.references/multi-provider.md for dual-provider or multi-issuer setups.Prefer these options when they fit the existing stack:
oidc-client-tsreact-oidc-contextGenerate custom PKCE and token exchange code only when the project constraints require it.
Prefer these options before writing custom JWT validation services:
spring-boot-starter-oauth2-client for login flowsspring-boot-starter-oauth2-resource-server for bearer token validationOnly fall back to manual JWKS lookup and custom validation logic when the provider or architecture requires non-standard behavior.
When producing code or a plan, cover the relevant items below.
Use the architecture that matches the product, not the most code-heavy option.
Use Authorization Code Flow with PKCE.
Include:
Be explicit about token storage tradeoffs.
Prefer backend-managed sessions and httpOnly cookies.
This is usually the safer default when:
Keep provider-specific configuration explicit.
When responding to a user task, produce only what is needed for that repository and request.
Prefer this order:
Avoid pasting large tutorial blocks if the task only needs a narrow change.
Watch for these failure modes:
Use compact patterns instead of oversized examples.
export const oidcConfig = {
authority: import.meta.env.VITE_OIDC_AUTHORITY,
clientId: import.meta.env.VITE_OIDC_CLIENT_ID,
redirectUri: `${window.location.origin}/auth/callback`,
scope: 'openid profile email',
responseType: 'code',
};
If the app is a public client, add PKCE support.
spring:
security:
oauth2:
resourceserver:
jwt:
issuer-uri: https://idp.example.com
Prefer this direction over handwritten JWT parsing when standard Spring Security support is sufficient.
For fuller examples, read the relevant file from references/ rather than pasting every variant by default.
Before considering the integration complete, verify the relevant flows:
This skill should help the model make a correct architectural choice first, then implement the smallest sound solution for that stack. Favor safe defaults, existing framework support, and repository-specific adaptation over generic auth boilerplate.