Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

oauth-flow-test-author

БесплатноБез исполняемых скриптовНе проверен

Use whenever an OAuth 2.0 or OpenID Connect client or resource server needs tests, whatever the identity provider: auth code with PKCE, client credentials…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

oauth-flow-test-author

Overview

OAuth 2.0 (RFC 6749) defines four grant types per datatracker.ietf.org/doc/html/rfc6749:

"1. Authorization Code (§1.3.1): The authorization code is obtained by using an authorization server as an intermediary between the client and resource owner. 2. Implicit (§1.3.2): The implicit grant is a simplified authorization code flow optimized for clients implemented in a browser using a scripting language such as JavaScript. 3. Resource Owner Password Credentials (§1.3.3): The resource owner password credentials (i.e., username and password) can be used directly as an authorization grant to obtain an access token. 4. Client Credentials (§1.3.4): The client credentials can be used as an authorization grant when the authorization scope is limited to protected resources under the control of the client."

Per RFC 9700 (OAuth 2.0 Security Best Current Practice, March 2025):

  • Implicit grant is deprecated.
  • Resource Owner Password Credentials grant is deprecated.
  • Authorization Code with PKCE (per datatracker.ietf.org/doc/html/rfc7636) is the canonical flow for all clients, public or confidential.

This skill is the per-flow test recipe. The canonical authorization-code + PKCE flow is authored end to end in the Worked example below; the less-common grants and negative cases live in references/per-flow-test-recipes.md.

When to use

  • Authoring tests for an OAuth 2.0 / OIDC client (web, mobile, SPA, M2M).
  • Reviewing PRs that touch auth-flow code.
  • The team needs flow-coverage independent of the IdP choice (Keycloak / Auth0 / Okta / mock).

How to use

  1. Identify the grant(s) the client uses from the flow-selection table below.
  2. Author the authorization-code + PKCE happy path (the Worked example) - the canonical flow for browser / native / mobile clients.
  3. Add the negative and secondary-grant tests each client needs (state CSRF, client-credentials, refresh-token rotation, OIDC nonce, scope-downgrade, redirect-URI) from references/per-flow-test-recipes.md.
  4. Run the end-to-end coverage checklist for every OAuth/OIDC client in scope.

Flow-selection decision surface

Client type Grant to test Required tests Recipe
Browser / SPA / native / mobile Authorization Code + PKCE (S256) Happy path + state CSRF + redirect-URI + (OIDC nonce if openid) Worked example + references
Machine-to-machine (M2M) Client Credentials Happy path; assert no refresh_token references
Any client holding a refresh token Refresh Token Rotation + reuse-detection references
Any OIDC client Authorization Code + ID Token Nonce match + scope-downgrade Worked example + references
Legacy Implicit / RO-Password (none - deprecated per RFC 9700) Migrate to Auth Code + PKCE -

Worked example - authorization-code + PKCE (canonical)

Per RFC 6749 §4.1 (per rfc6749) the flow:

  1. Client directs resource owner to authorization endpoint with client_id, redirect_uri, response_type=code, scope, state (RECOMMENDED for CSRF defense per §10.12), nonce (OIDC), and PKCE params (code_challenge + code_challenge_method).
  2. Authorization server authenticates the resource owner.
  3. Server redirects back to client with the authorization code + the original state.
  4. Client requests token endpoint with grant_type=authorization_code, code, redirect_uri, client_id, and PKCE code_verifier.
  5. Server returns access token (+ refresh token + ID token if OIDC).

PKCE per RFC 7636 §4.2 (rfc7636):

"Two methods are defined:

  • plain: code_challenge = code_verifier
  • S256: code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))"

Always use S256; plain defeats the purpose of PKCE.

Test pattern (Python with requests + Playwright for browser flow):

import secrets, hashlib, base64, requests
from urllib.parse import urlparse, parse_qs

def make_pkce_pair():
    verifier = secrets.token_urlsafe(64)
    challenge = base64.urlsafe_b64encode(
        hashlib.sha256(verifier.encode("ascii")).digest()
    ).rstrip(b"=").decode("ascii")
    return verifier, challenge

def test_authz_code_pkce_flow(idp_url, client_id, redirect_uri, browser):
    verifier, challenge = make_pkce_pair()
    state = secrets.token_urlsafe(32)
    nonce = secrets.token_urlsafe(32)

    # Step 1: redirect to authorize endpoint
    authz_url = (
        f"{idp_url}/authorize?"
        f"client_id={client_id}&response_type=code&"
        f"redirect_uri={redirect_uri}&scope=openid+profile&"
        f"state={state}&nonce={nonce}&"
        f"code_challenge={chal
Полный SKILL.md на GitHub

Установить oauth-flow-test-author в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonevals/partner-retires-api-keys-in-nine-days/criteria.jsonevals/partner-retires-api-keys-in-nine-days/task.mdevals/pentest-finding-the-author-says-is-wrong/criteria.jsonevals/pentest-finding-the-author-says-is-wrong/task.mdevals/pkce-exchange-fails-three-times-in-four/criteria.jsonevals/pkce-exchange-fails-three-times-in-four/task.mdevals/red-auth-suite-turned-green-in-one-afternoon/criteria.jsonevals/red-auth-suite-turned-green-in-one-afternoon/task.mdevals/thirty-day-sessions-go-live-on-monday/criteria.jsonevals/thirty-day-sessions-go-live-on-monday/task.mdreferences/per-flow-test-recipes.md

FAQ

Что делает скилл oauth-flow-test-author?

Use whenever an OAuth 2.0 or OpenID Connect client or resource server needs tests, whatever the identity provider: auth code with PKCE, client credentials, refresh-token rotation and reuse detection, state and nonce checks, scopes and strict redirect-URI matching, per the RFCs.

Как установить скилл oauth-flow-test-author?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл oauth-flow-test-author запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить oauth-flow-test-author с