atomic

flowstate-flowstate-platform-epicdm-auth-client

Package-local agent skill for @epicdm/auth-client.

Tags

Publisher

Versions

1 version published — latest: 0.1.0

  • 0.1.0
    publishedInvalid Date

Skill

auth-client Package Skill

Package: @epicdm/auth-client Repository: flowstate-platform Path: packages/shared/auth-client Version: 0.1.0

Use this published Dojo skill as the package-level entrypoint. For detailed workflows, use the package-local skills listed below.

Primary Package Workflow

Auth Client OIDC PKCE Workflow

Status: Active Purpose: Keep FlowState app login flows consistent with the shared OIDC client. Scope: packages/shared/auth-client Trigger: An app login/callback flow or shared auth-client behavior needs to change. Input: Issuer URL, client ID, redirect URI, optional scopes, optional client secret, callback code, nonce, and code verifier. Output: Correct authorization URL, token exchange, and verified ID token claims.


Workflow

  1. Create the client with createAuthClient({ issuerUrl, clientId, redirectUri, scopes, clientSecret }).
  2. On login, call buildAuthorizationUrl() and persist state, nonce, and codeVerifier in the app's secure callback storage before redirecting.
  3. On callback, validate returned state in the consuming app, then call exchangeCode(code, codeVerifier).
  4. Verify the returned ID token with verifyIdToken(idToken, nonce, kv?). This fetches JWKS, requires RS256, verifies signature, and checks issuer, audience, expiration, and nonce.
  5. Use fetchJWKS(kv?) only when a caller explicitly needs key material; prefer verifyIdToken for login.
  6. Before changing the API, check consumers with rg "createAuthClient" packages --glob '!**/node_modules/**'.

Verification

  • yarn workspace @epicdm/auth-client test
  • yarn workspace @epicdm/auth-client typecheck
  • yarn workspace @epicdm/auth-client lint

Red Flags

Red flagRequired action
State, nonce, or code verifier not persistedFix the consuming app flow before callback exchange.
Non-RS256 ID token acceptedPreserve the algorithm check in verifyIdToken.
Issuer or audience skippedKeep both checks strict.
JWKS fetched on every request despite KV availabilityPass KV where the runtime supports it.

Composition

  • Use flowstate-identity-oidc-auth-workflow when changing the issuer-side OIDC routes.
  • Use app-local skills for session cookie or profile persistence after ID token verification.

Package Skill Inventory

Skill Inventory: @epicdm/auth-client

Created Skills

SkillTypeTrigger
auth-client-oidc-pkce-workflowWorkflowUse when integrating or changing shared OIDC/PKCE auth-client behavior.

Candidate Future Skills

CandidateReason to Split Later
auth-client-jwks-verificationJWKS caching and RS256 verification may need deeper troubleshooting if key rotation changes.
auth-client-app-callbacksConsumer app callback/session storage can become a cross-app implementation pattern.

Source Evidence

  • src/index.ts implements client creation, PKCE URL generation, token exchange, JWKS fetch, and ID token verification.
  • src/__tests__/auth-client.test.ts verifies authorization URL and scope behavior.
  • Downstream src/lib/oidc/client.ts files import createAuthClient.

Review Gate

Review: @epicdm/auth-client Skills

Result: Pass for source-backed package-local workflow guidance.

Checks

  • The skill teaches the exact OIDC/PKCE state machine and verification invariants.
  • It cites source, tests, and downstream app consumers.
  • Verification commands are package-local and lightweight.
  • Generated .flowstate/dojo files were not modified.

Residual Risk

Callback/session persistence differs by app and may need app-local skills rather than expansion here.

Usage

Start with this skill to understand the package purpose, then use the package-local focused skills for specific workflows. Keep this Dojo version aligned with packages/shared/auth-client/package.json. Do not treat generated feature lists as lessons; use workflow evidence from CODE-REVIEW.md, SKILL-INVENTORY.md, and REVIEW.md.

Install

Run this in your project to install via CLI:

fscloud dojo skill install flowstate-flowstate-platform-epicdm-auth-client --target <target> --out ./skills

Replace <target> with your agent target identifier. See the CLI docs for details.

flowstate-flowstate-platform-epicdm-auth-client | dojo.epicflowstate.ai | Epic Dojo