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

saml-identity-provider

Maintain upstream SAML identity-provider authentication, request/response browser binding, ACS and assertion validation, pinned signing certificates, and signed TLS/browser tests.

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

설치 방법 보기

포함된 파일(2)

  • SKILL.md5.6 KB
  • agents/openai.yaml299 B

SKILL.md(원문)

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

SAML Identity Provider

Read external account attachments when changing local provisioning, connection UI, immutable external keys, or attachment binding in this consumer.

pkg/idp/saml owns provider configuration, metadata, service providers and request state. pkg/authn supplies the browser transport. Use shared provider construction and public portal consumers in tests; do not conflate downstream OIDC sessions with upstream SAML authentication.

Configuration boundary

pkg/idp/saml.Config owns name, realm, driver, metadata location, signing pin, IdP login URL, ACS URLs, TLS settings, and login-icon configuration. Its Validate checks required values and applies the azure or generic driver behavior; saml.NewIdentityProvider constructs the runtime. Shared idp.IdentityProviderConfig dispatches SAML parameters through idp.NewIdentityProvider.

The new attachment field uses identity/attachment/parser, with shared dispatcher and consumer coverage. There is no dedicated full SAML directive-parser package or SAML constructor in pkg/idp/parser; that package currently adapts only OAuth. This is an existing configuration-parser conformance gap. Do not invent a supported SAML directive API, or infer one from an embedding server's configuration syntax. A change to this configuration surface must include its parser and consumer coverage under the shared parser contract.

Browser transaction and trust

GET initiates an SP AuthnRequest. RelayState is a random transaction identifier, never a redirect destination or browser credential. Bind it server-side to the initiating browser secret, exact configured ACS callback, AuthnRequest ID, validated post-login destination and a five-minute deadline. Admit matching callbacks atomically once, before XML validation; failed verification requires a new initiation. Capacity is bounded; expiry reclamation must not allow replay or evict active state to admit another request. No unconditional IdP-initiated acceptance is supported.

The initiating GET captures the validated destination. The provider clears any callback-supplied destination and releases the stored value only after assertion verification. ReturnURLBound preserves an empty choice; a callback query or shared redirect cookie cannot replace it. See the redirect trust boundaries.

The portal browser binding must survive a real cross-site HTTP-POST callback. A default/Lax session cookie is insufficient even if Go's cookiejar sends it in TLS tests. Use the dedicated factory-managed SAML binding cookie with host-only, Secure, HttpOnly, SameSite=None attributes, independent of the ordinary session cookie and RelayState. Each initiation has its own cookie named <configured SAML base>_<canonical RelayState>; its value is an independent random secret. The provider returns runtime Response.LoginState on initiation so the portal can issue it. Accept exactly one matching cookie. Delete only that transaction's cookie on success. An initiation already carrying 16 transaction cookies returns 429 rather than evicting another login's proof. This request-cookie check is not an atomic browser-wide quota: simultaneous initiations can arrive before their new cookies are visible. The provider's server-side state capacity remains atomic; expired browser proofs disappear after five minutes. Domain-scoped session IDs must not supply SAML proof. Legacy static SAML-cookie factory helpers remain available, but portal callbacks use transaction helpers. Cookie names/configuration/parsing/collision checks belong to portal cookies.

Pass only the stored AuthnRequest ID to the SAML verifier with AllowIDPInitiated=false. Keep exact destination/recipient, issuer, audience, signature, time and subject-confirmation checks. Callback selection comes from the actual mounted request, never a caller-supplied RelayState URL.

IdpSignCertLocation is the authoritative signing pin. Remove all metadata signing-capable descriptors (use signing or omitted) across every IdP SSO partition; preserve explicit encryption descriptors. Metadata must not widen trust by adding another certificate. This is exact signing-certificate trust, not permission for arbitrary descendants of a configured CA certificate.

Acceptance and validation

Unit tests cover state lifetime/capacity/concurrency and certificate precedence. pkg/authn/saml_state_e2e_test.go uses real signed responses and a TLS portal: reverse-order same-browser tabs with distinct destinations, cookie-capacity recovery, valid login, missing/wrong-browser/wrong-callback/replayed state and rogue metadata cert rejection. Preserve a real Chrome cross-site POST journey for cookie semantics; a net/http cookiejar alone cannot validate SameSite. Document migration from earlier unsolicited IdP responses and test only synthetic local IdPs.

make test TEST_DIR='./pkg/idp/saml ./pkg/authn/cookie/... ./pkg/authn' TEST='SAML|Saml|StateManager' COVERAGE_DIR=.coverage/saml

A valid signed response from the initiating browser at the bound ACS succeeds once. Wrong-browser, wrong-callback, expired, replayed, or metadata-only rogue signing credentials cannot issue a portal token. Retain a successful control alongside each rejection so transport failure cannot masquerade as validation.

리뷰

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

댓글

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

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

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. 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의 스킬 모두 보기

이 스킬의 문제 신고