認証ポータルのログインやトークン更新、プロフィール、管理APIを利用するHTTPクライアントの仕様確認とトラブル対応を支援します。
- ポータル向けJSONログインを実装したいとき
- ブラウザーのトークン更新を調べたいとき
- ネイティブ認証APIを扱いたいとき
Caddyの認証ポータルとルートへの認証処理を設定し、利用するログイン元やリダイレクト先の信頼条件、更新機能などを組み立てるスキルです。
Configure authentication portals, backend selection, redirect trust, refresh, Documents storage, and portal wiring. Delegates cookies, UI, transforms, crypto, and OIDC provider details to focused skills.
実行スコア 未検証
インストール方法を見るCaddyのauthentication portalブロックと、ルートで認証を実行するauthenticate withハンドラーを設定します。ポータルで使うIDストアや認証プロバイダーを選び、ルートからポータルへ接続します。ログイン・ログアウト後のリダイレクト先を信頼する条件、トークン更新、Documentsストレージ、ユーザー登録の接続など、ポータル全体の基本構成を扱います。Cookie、画面UI、ユーザー変換、暗号鍵、OIDCプロバイダーなどの詳細設定は、それぞれの専用スキルに引き継ぎます。
新しい認証ポータルを作るときや、どのログイン元を有効にするか整理したいときに役立ちます。保護対象ルートとの接続、リダイレクト先の制限、更新機能やDocumentsの設定場所を確認する場合にも使えます。
/private/*の認証に接続して」ポータルには少なくとも1つのIDストアまたは認証プロバイダーが必要です。SSOアプリ用プロバイダーだけではログイン元になりません。更新設定やDocuments保存先には専用の設定項目があり、Cookie、UI、暗号、OIDCなどは各専用スキルで扱います。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Use this skill to configure authentication portal <name> blocks and the
route-level authenticate with <portal> handler.
Use configuration-http-integrations to place portal routes, select matchers, wire same-host or split-host portals, separate portal/protected routes, and check directive ordering.
Read these files when details matter:
caddyfile_authn.go for the portal block.caddyfile_authn_token_refresh.go and token refresh
for readable portal refresh configuration, explicit eligible realms, transports,
bounded lifetimes and stores, cookies, placeholders and TLS validation.
Read named refresh storage for explicit SQLite
selection, private file ownership, root-state generations and commit recovery.caddyfile_authn_documents.go and Documents configuration
for flat API directives, explicit local realms, private storage, quotas,
runtime values and permanent origin/mount bindings.caddyfile_authn_crypto.go for crypto key directives.caddyfile_authn_misc.go for enable, validate, and trust.caddyfile_authn_admin_api.go and selected upstream
pkg/authn/admin_api/parser for the independent admin/API key-export switches.plugin_authn.go for route-level authenticate syntax.../go-authcrunch/config.go for portal
validation, default backend attachment, and user registration wiring.../go-authcrunch/pkg/authn/config.go and
../go-authcrunch/pkg/authn/portal.go for
portal defaults and runtime behavior.Use focused repo-local skills for specialized portal sub-blocks:
oidc provider blocks, named client selection, private
registrations, and dedicated provider signing keys.
Its provider reference
covers explicit realm participation and separate issuers/cookie scopes across
portals; attaching a store for portal login does not enable its realm for OIDC.crypto defaults, JWT signing keys, auto-generated keys, token names
and lifetimes, secret-backed key material, System API system keys, and
explicitly selected access signer and access token profile settings.cookie directives and token-cookie naming.ui blocks, templates, static assets, custom CSS/JS/HTML, themes,
languages, logos, and private links.transform user blocks, ACL matchers, typed claims, conditional
challenge selection, additive legacy requirements, claim replacements, and
transform UI links. Persisted local-user challenge rules belong to
configuration-users.saml identity provider <name> login providers enabled by the portal./whoami, /beacon, refresh token, Documents,
and admin/server API interactions.{
security {
local identity store localdb {
realm local
path assets/config/users.json
}
authentication portal myportal {
crypto default token lifetime 3600
crypto key sign-verify {env.JWT_SHARED_KEY}
enable identity store localdb
}
}
}
example.com {
@portal path /auth /auth/*
route @portal {
authenticate with myportal
}
}
The portal name must match the authenticate with <portal> reference.
Route-level syntax also allows a matcher: authenticate @matcher with <portal>.
Use myportal or a descriptive name such as employee_portal in examples,
fixtures, and tests. Avoid naming a portal portal: the repeated words in
authentication portal portal are confusing. Keep references consistent, for
example authentication portal myportal and authenticate with myportal.
Add only the backends the portal should use:
enable identity store localdb
enable identity provider github azure
enable sso provider aws
Define those stores, identity providers, or SSO app providers with the matching
domain skills before enabling them. enable identity provider <name> references
oauth identity provider <name> or saml identity provider <name> blocks;
enable sso provider <name> references sso provider <name> SSO app blocks.
Identity stores and identity providers can take multiple names on one line.
If a portal has no explicit identity stores and no explicit identity providers,
authcrunch currently attaches all configured identity stores and identity
providers during Config.Validate(). Prefer explicit enable lines in new
examples. After defaults and disabled-backend filtering, a portal must have at
least one identity store or identity provider; SSO providers are additional app
providers and do not satisfy the login-backend requirement by themselves.
User registration is global configuration. enable user registration <name> [<name>...] selects named registries whose identity stores must also be enabled
in this portal. External SQLite workflows require this explicit selection.
Without a nonempty selection, legacy user registration <name> blocks attach
automatically to eligible stores. Signup visibility belongs to each portal's
attached registry metadata. See registration configuration
for the different confirmation and account-activation policies.
Use crypto keys for token signing and verification:
crypto default token lifetime 3600
crypto key sign-verify {env.JWT_SHARED_KEY}
Use both enable source ip tracking and validate source address when issued
tokens should carry and verify the source address. The first sets authcrunch
token grantor source-address tracking; the second makes the token validator
enforce the source-address claim.
Trusted redirect URI checks support login and logout redirect targets:
trust login redirect uri domain exact example.com path prefix /app
trust logout redirect uri domain example.com path /
The match type is optional and defaults to exact; supported match types are
exact, partial, prefix, suffix, and regex. Both domain and path
need values. Keep login/logout, redirect, and uri as separate header
tokens. Quoted domain/path values remain data even when they contain those
words; they cannot change which redirect trust list receives the rule.
Login destinations belong to their individual login flows. A rejected, explicitly
bound destination returns to <portal-mount>/portal?redirect_url=. Preserve the
empty marker: it prevents fallback to another tab's return cookie. Legacy local
form submissions without a bound destination can still return to
<portal-mount>/portal. TestCaddyAuthorizationRedirectE2E checks untrusted-target
rejection through OAuth transactions and legacy local POST/cookie fallback over
HTTP/1, HTTP/2, and HTTP/3. The refresh browser E2E checks explicit continuation.
Read login destinations and concurrent tabs
for bound destination precedence, fresh-login intent, browser proof isolation
and the local/provider/Chrome acceptance surfaces.
Enable admin/server API endpoints only when they are needed and protected by an authenticated admin session:
enable admin api
Both enable and disable are supported for admin api and
admin api private key export. Each setting occurs at most once in the portal;
both default to disabled. Key export does not implicitly enable the API and
requires both flags plus authenticated admin authorization at runtime.
See authentication-portal-api for /api/server/metadata,
/api/server/realms, /api/server/info, JSON login, /beacon, and /whoami
behavior. Admin API troubleshooting should check the directive, the active
portal session, and whether the user has an admin role before changing route
layout.
Portal access uses built-in role tiers. authp/admin grants administrative
portal capabilities, authp/user grants normal user settings/profile
capabilities, and authp/guest is the fallback portal-only role when neither
admin nor user roles are assigned. When debugging portal UI access, search
debug logs for configured portal access-list rules and inspect transforms that
add or drop authp/* roles.
Use these fixtures as examples:
testdata/caddyfile_adapt/testcase_security_authentication_portal.Caddyfiletestdata/caddyfile_adapt/testcase_authenticate_with_registration.CaddyfileTestParseCaddyfileRedirectTrustMalformed and
TestParseCaddyfileRedirectTrustValues cover incomplete selectors and quoted
values. testcase_authenticate_with_redirect_trust_malformed must fail adaptation
with a parser error, not a panic. The redirect-trust subtest in
TestCaddyOAuthE2E verifies separate login/logout behavior over TLS and confirms
that rejected reconfiguration leaves the running portal usable.
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
認証ポータルのログインやトークン更新、プロフィール、管理APIを利用するHTTPクライアントの仕様確認とトラブル対応を支援します。
Caddyの認証・認可まわりで起きた設定や実行時の障害を、設定ファイル、ログ、バージョン、HTTPの証拠から切り分け、最小修正や調査報告にまとめます。
caddy-securityのGoコードやCaddyモジュール、Caddyfileパーサー、HTTP連携の実装・レビューで、境界やライフサイクル、エラー処理の規約を確認するスキルです。
caddy-securityのCaddyfile全体を作成・点検し、認証方式に合う設定ガイドを選びながらsecurityアプリとHTTPルートを配線するスキルです。
認証ポータルのCookie名や接頭辞、属性、ドメインを設定し、認可ポリシーが探すトークンCookieとの対応を整えます。
別の端末でポータルログインを承認する機能を設定し、QRコードによる開始、本人確認、明示的な承認、取消、期限や再起動時の動作を確認します。