← ClaudeAtlas

integrate-identity-providerslisted

Use when adding third-party login or identity verification to a backend — social login (Sign in with Google / Apple / Facebook) and national digital identity / KYC (e.g. Singpass) via the OIDC relying-party flow (authorization code + PKCE + state/nonce → token exchange), validating the resulting token (.well-known → JWKS signature + iss/aud/exp, or introspection), centralizing many IdPs behind one identity broker (e.g. Keycloak), mapping an external identity to your user by (provider, subject), and treating verified attributes as KYC-grade. Framework-flexible. The frontend login UI is in secure-a-frontend-app.
kennguyen887/agent-foundation · ★ 1 · Code & Development · score 77
Install: claude install-skill kennguyen887/agent-foundation
# Integrate identity providers Adding external **login** (Google/Apple/Facebook) and **identity verification / KYC** (e.g. Singpass) to a backend, the right way: as an **OIDC relying party** that delegates auth to the provider and **verifies the result cryptographically**. Examples name real public providers; the flow is a standard so it ports to any language. principle → **▸ Example** → **▸ Other stacks**. The *frontend* login UI + session (NextAuth, route guards) is `secure-a-frontend-app`; exposing *your own* API to partners is `integrate-external-services` §5. This skill is the backend/server + verification side. ## Core principle **Never roll your own identity or trust a client-supplied identity blob.** Delegate authentication to an OIDC provider, **verify the returned token's signature + claims** yourself, then map the external identity to your own user. For a KYC provider (Singpass), the returned attributes are **authoritative** — store them as verified, don't let the user edit them. ## 1. The relying-party flow (authorization code + PKCE) - **Redirect the user to the provider's `authorize` endpoint** with `state` (CSRF) + `nonce` (replay) + **PKCE** `code_challenge`; keep `state`/`code_verifier` server-side (or in a signed cookie). On the **callback**, check `state`, then **exchange the `code`** at the `token` endpoint for an `id_token` + `access_token`. Confidential clients authenticate the exchange with a **client secret or a signed `client_assertion` JWT