본문으로 건너뛰기
cccskills
무료GitHub에 공개

authentication-portal-mfa

Maintain portal TOTP and WebAuthn login checkpoints and enrollment, server-side challenges, factor-specific verification, replay prevention, and real TLS MFA journeys.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md6.6 KB
  • agents/openai.yaml308 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Authentication Portal MFA

Ownership and login evidence

handle_http_sandbox.go and handle_json_login.go own login checkpoints; webauthn_enrollment.go and the profile U2F API handlers own registration state. pkg/identity owns credential validation, durable TOTP consumption and mutation. The collaborating contracts are local database transactions for durable mutation and canonical login evidence for identity binding. Authentication challenge policies own conditional selection, user-transform/parser APIs, and AMR issuance. Successful verification sets the server-only Checkpoint.Method; enrollment never does. JSON hardware authentication must retain its server challenge and pass the actual assertion to the backend, including when U2F is the first checkpoint. After generating a JSON WebAuthn assertion challenge, return immediately and wait for its signed response. Do not visit later password/TOTP checkpoints or set authentication evidence during challenge issuance. Cover WebAuthn before, after, and between other factors through HTML and JSON, including generic MFA selection and additive password requirements.

Keep required factor types distinct. A totp checkpoint cannot pass with U2F, and a u2f checkpoint cannot pass with TOTP; only generic mfa permits selection. Seed every MFA backend operation with the original server-held LoginEvidence, including lockout check/increment/reset and TOTP consumption. Authentication can clear request evidence on failure; restore the original proof before counting a failure. A password reset, role change, revocation or replacement must prevent old sandboxes from consuming codes or mutating the current account's lockout.

Cross-realm lockout E2E tests must establish fresh password evidence for each attempt: refreshing a database alias can invalidate its older sandbox epoch. Keep separate stale-sandbox tests proving rejected evidence cannot consume a code or increment current lockout state. Invalid TOTP fixtures must exclude accepted neighboring time steps as well as the current code.

Login TOTP uses atomic ConsumeMfaTOTP, not stateless diagnostic passcode checks. A test reusing the same accepted step must fail. Successful sequential fixture logins need a fresh step; do not weaken persistent replay protection for tests. Login WebAuthn requires the server challenge and exact expected origin, RP hash, client-data type, signature and user presence. Trusted request metadata derives the origin; forwarded-header normalization belongs to the embedding server.

The current u2f route supports account-first WebAuthn, including as the sole authentication checkpoint. It requests user_verification: "discouraged" and requires user presence; it does not require the authenticator's UV flag. Do not describe factor-only selection as username-free/discoverable-credential login or a guarantee of PIN/biometric verification. Those capabilities need separate protocol/configuration work and browser/authenticator validation.

Enrollment is a credential mutation, never authentication with the new factor. Sandbox first-factor enrollment requires no enabled existing factor and current identity evidence. After successful enrollment require a new completed login; never advance the original sandbox's evidence version to allow token issuance.

Enrollment and lifecycle

Keep mfa_add_app.js and sandbox_mfa_add_app.js aligned when changing TOTP enrollment rendering. Encode each OTP label/query component independently and the QR payload as unpadded URL-safe Base64 in one canonical URL path segment. Percent-encoding standard Base64 padding sets URL.RawPath, which refresh-enabled sandboxes reject. Keep those origin/path checks strict; barcode handlers accept both legacy standard Base64 and the canonical URL-safe form. Resolve the QR endpoint against the portal origin and require same-origin HTTP(S) before assigning the image URL. DOM text must remain data throughout link and image construction. Preserve the existing image's localized alt text when replacing it. Cover both scripts with the MFA DOM client tests and the real Chrome rendering fixture. Require a real refresh-enabled enrollment journey to load the regenerated PNG; a valid-looking src attribute alone does not prove the image endpoint accepts it.

WebAuthn enrollment state is local to the portal: 5-minute expiry, 4096-entry bound, single use, discarded on Close/restart. Bind it to realm, canonical account, immutable ID, backend/credential versions, session, origin and profile/sandbox scope. Creation uses a random server challenge. Profile registration pins the validated payload digest and requires a signature over a separate server-issued proof challenge before final save. Atomically claim verification, verify outside the state lock, then recheck entry identity/expiry. Consume before persistence; a failed write requires restarting the ceremony.

The legacy profile client carries the original creation challenge in later requests while the signed proof contains the distinct proof challenge. Preserve that wire contract. identity.ValidateWebAuthnRegistration validates creation client data, RP hash, flags, credential IDs and typed COSE input before key construction; it does not verify an attestation statement. Its compatibility allowance for the known legacy nested credential-ID truncation is exact, not an arbitrary-prefix exemption. Trusted provisioning constructors remain separate.

Acceptance and validation

Unit tests cover state phases, clock boundaries, concurrency, digest/binding changes and malformed creation data. TLS enrollment tests cover direct-save rejection, wrong user/session/origin/challenge, replay, changed identity, transformed claims, renewed sessions, persistent key ownership and a fresh signed hardware login. Browser hardware/attestation certification needs separate evidence; synthetic signatures do not establish it.

make test TEST_DIR='./pkg/identity ./pkg/authn' TEST='MFA|Mfa|TOTP|WebAuthn|AuthenticationChallenge|IdentityAlias' COVERAGE_DIR=.coverage/portal-mfa
make test-ui

A valid enrolled factor completes only its required checkpoint. A replayed TOTP, wrong-origin assertion, or revoked sandbox produces no credential and cannot mutate a replacement account. Successful enrollment persists the new factor, invalidates the old evidence, and requires a fresh completed login.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

authdb

무료

Maintain the standalone cmd/authdb server, pkg/httpserver listener and portal routing, HTTP configuration parser, TLS, shutdown, executable tests, and deployment guidance. Use authdbctl for the management client.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 20일 업데이트

authdbctl

무료

Maintain cmd/authdbctl commands, flags, configuration, terminal input, management retries, output, and executable E2E tests. Use authentication-client for the reusable portal login protocol.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 20일 업데이트

Maintain or embed pkg/authclient for portal login, password/TOTP and API-key authentication, native credential transport, configuration parsing, and credential files. Covers authdbctl login wiring; management commands and the admin API have separate owners.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 20일 업데이트

Maintain conditional authentication challenge policies, reusable authchal and user-transform FromDirectives parsers, safe claim substitution, GitHub ID/organization transforms, registered-factor inventory, passwordless WebAuthn selection, verified AMR access claims, and policy revalidation across portal login, refresh, OIDC, and direct authentication.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 20일 업데이트

Maintain portal cookie configuration, reusable cookie directive parsing, common prefixes and explicit names, domain attributes, factory issuance/deletion, and cookie interoperability with OIDC, refresh, OAuth, and gatekeepers.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 20일 업데이트

Maintain optional cross-device portal login, its directive parser, QR and polling UI, approving-browser binding, single-use transfers, MFA and provider evidence, logout invalidation, and TLS/browser tests.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

greenpau/go-authcrunch602026년 10월 20일 업데이트

greenpau의 스킬 모두 보기

이 스킬의 문제 신고