/didit-authentication:didit-auth-integratefrom Didit Authentication
Guides integrating Didit hosted sign-in with PKCE flow, token exchange, validation via JWKS, session checks, and logout. Use when adding Didit authentication to an app or backend.
Ships in Didit 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.
Follow the rules of didit-auth-start first: call didit_context_get for the application, and call didit_docs_search for the current tokens and quickstart pages before writing code. Docs mark Authentication as new. Never put a secret, a token or an API key in code, URLs or logs.
The docs list official packages per platform: @didit-protocol/auth (JavaScript, with verifyToken in @didit-protocol/auth/server), @didit-protocol/auth-react, @didit-protocol/auth-nextjs, the DiditAuth Swift package, me.didit:didit-auth for Android, @didit-protocol/auth-react-native and didit_auth for Flutter. Read the matching quickstart for the current version and setup. Build the steps below by hand only when no SDK fits.
https://<slug>.auth.didit.me (live) or https://<slug>.sandbox.auth.didit.me (sandbox), or a verified custom domain. The console shows it.redirect_uri must match character by character. Live accepts only https://; sandbox also accepts http:// on localhost, 127.0.0.1 or [::1]. No wildcards, fragments or custom schemes.pk_live_... or pk_test_...) identifies the application. It is not a secret.Clients are public: no client secret. client_id is the application ID. PKCE method S256 only.
state. Keep both in the tab or app that starts sign-in.{issuer}/sign-in with redirect_uri, state (up to 512 characters), code_challenge (base64url SHA-256 of the verifier, 43 characters) and code_challenge_method=S256. Optional: nonce, scope, login_hint (prefills the email only), ui_locales, max_age, prompt.redirect_uri with code and state. Reject the callback if state does not match.Within 60 seconds, once per code, send to {issuer}/token/ (JSON or form body):
POST {issuer}/token/
grant_type = authorization_code
code = <code from the callback>
code_verifier = <the PKCE verifier>
redirect_uri = <the same redirect_uri>
The answer holds access_token, id_token, refresh_token, token_type, expires_in and session_id. 400 invalid_grant covers an unknown, used or expired code, a verifier or redirect mismatch, a blocked person, and similar cases. Do not send client_secret; it is rejected as an unknown field.
The access token is a JWT with header alg: ES256 and typ: at+jwt, valid for at most 5 minutes. Verify it offline on every request against the issuer's JWKS; keep GET {issuer}/session/ for the moments that need a stricter check (step 5). Read the current tokens page with didit_docs_search (https://docs.didit.me/authentication/tokens-and-jwks) and cite it.
verifyToken from @didit-protocol/auth/server (see the JavaScript quickstart, https://docs.didit.me/authentication/quickstarts/javascript), or a JWT library such as jose with the checks below, as the tokens page shows. Name only packages the docs name.Take the issuer and application ID from configuration, never from the token. Check all of these:
alg is ES256 and typ is at+jwt. Reject anything else, none included.kid is in {issuer}/.well-known/jwks.json and the signature verifies.iss equals the configured issuer; aud equals the application ID.exp and iat are valid with up to 60 seconds of clock skew; sub, sid and jti are present.act is null. A non-null act is an AI agent acting for the person: reject it unless the endpoint accepts agents, then allow only what act.scopes grants.Keys: cache the JWKS for 5 minutes, keyed by kid. For an unknown kid, refetch at most once a minute, then reject. Keys rotate every 30 days with a day of overlap.
Useful claims: sub (the identity in this application), vendor_data (the same person across Didit products), amr, org, verified. The ID token has typ: JWT and adds auth_time, email_verified and, when set, email, name, phone_number. Check nonce on the ID token from the code exchange only. Never accept an ID token as an access token.
Offline JWT checks cannot see a session that just ended. Before a sensitive step (a payout, for example), call GET {issuer}/session/ with the access token as a Bearer token. A 401 invalid_token means this access token is no longer accepted: the session may have ended, or the token expired. Refresh once; if the refresh answers 400 invalid_grant, treat the person as signed out. A 429 or 503 proves nothing either way: block the sensitive step and retry later. It is rate limited, so do not call it on every request.
Send grant_type = refresh_token and refresh_token to {issuer}/token/. Access tokens last at most 5 minutes.
400 or no answer, start sign-in again; do not retry blindly. On 503 temporarily_unavailable, retry with backoff. On 429, wait for Retry-After.Signing out has two parts. Report them separately:
DELETE {issuer}/session/ with the current access token. Only a 204 confirms the session was revoked on the server.A 401 here means the access token was rejected, not that the session ended: refresh once, then send the DELETE again with the new token. If that refresh answers 400 invalid_grant, the session cannot be refreshed; treat the person as signed out locally. Never report the server session as ended without a 204. A lost answer means different things for the two requests:
DELETE (or a 429 or 503): revocation is not confirmed. Retrying the same DELETE with the same access token is safe, because it replays no refresh token: retry with backoff and respect Retry-After. If the retry answers 401, the first one may have ended the session; report server sign-out as not confirmed.Then send the person to the configured post_logout_redirect_uri, if any. There is no end-session endpoint.
Keep verification API keys and console tokens on the server. Keep browser access tokens in memory where possible, or in secure HttpOnly cookies with CSRF protection. Store mobile refresh tokens in platform-protected storage.
What SKILL.md sets; muted values are Claude Code's defaults
4 skills in this plugin
/didit-auth-eventsExplains how Didit sign-in activity shows up and how to react to it. Use when the user asks "which auth webhooks exist", "what does the sign-in webhook send", "subscribe to sign-in events", "sign-in risk", "failed logins", "use sign-in events in fraud rules", or how sign-in links to verification and transaction monitoring with Didit./didit-auth-sign-in-methodsHelps choose and set up the sign-in methods their users get with Didit Authentication. Use when the user asks about "passkeys", "magic links", "email or phone codes", "social sign-in", "organization SSO", "MFA", "password reset", "who can sign up", "invitations", "redirect URLs", "bot protection", "sign in with a selfie", "verify identity at sign-up", "custom sign-in domain", or building their own sign-in screens with Didit./didit-auth-startnpx claudepluginhub didit-protocol/skills --plugin didit-authenticationOther plugins' skills for the same job