Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Oauth Oidc Integration?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/ansh44233-oauth-oidc-integration)
---
description: Integrate OAuth 2.0 and OpenID Connect login correctly with PKCE, state, token validation and account linking
profile: standard
tags: security, oauth, oidc, authentication
---
# OAuth and OIDC integration
Use a maintained library (Auth.js, openid-client, Authlib, Spring Security); never hand-roll token validation.
## Flow
- Authorization code flow with PKCE for all clients; never the implicit flow.
- Random `state` (and `nonce` for OIDC) bound to the session and checked on callback.
- Redirect URIs exactly allow-listed.
## Tokens
- Validate ID tokens: signature (via JWKS), `iss`, `aud`, `exp`, `nonce`.
- Store refresh tokens server-side, encrypted; never in localStorage.
## Accounts
- Link providers to accounts by verified email only; handle email changes at the provider.
## Verify
Tests cover a callback with a wrong `state`, an expired ID token and a wrong audience: all are rejected.