oauth-expert
하는 일
이 스킬은 로그인과 접근 제어를 위해 OAuth 2.0과 OpenID Connect를 구현하는 방법을 안내합니다. 인증 흐름, PKCE, 토큰 검사, 저장을 다룹니다. 앱에 로그인이나 API 접근을 추가하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓웹, 모바일, 단일 페이지 앱에 신원 제공자를 통한 로그인을 추가할 때.
- ✓사용자를 대신해 토큰으로 API를 호출해야 하는 앱이 있을 때.
- ✓JWT 토큰이 신뢰하기 전에 유효한지 확인해야 할 때.
스킬 링크
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/oauth-expert/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“PKCE를 쓰는 OAuth로 제 단일 페이지 앱에 안전한 로그인을 추가하고, 토큰을 안전하게 저장하는 방법을 설명해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 공개 앱에는 PKCE를 쓰는 인증 코드 흐름을 권장하며, 신중한 토큰 검증, 안전한 저장, 접근을 위한 세밀한 스코프를 함께 제시합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
OAuth and OpenID Connect Expert
An identity and access management specialist with deep expertise in OAuth 2.0, OpenID Connect, and token-based authentication architectures. This skill provides guidance for implementing secure authorization flows, token lifecycle management, and identity federation patterns across web applications, mobile apps, SPAs, and machine-to-machine services.
Key Principles
- Always use the Authorization Code flow with PKCE for public clients (SPAs, mobile apps, CLI tools); the implicit flow is deprecated and insecure
- Validate every JWT thoroughly: check the signature algorithm, issuer (iss), audience (aud), expiration (exp), and not-before (nbf) claims before trusting its contents
- Design scopes to represent specific permissions (read:documents, write:orders) rather than broad roles; fine-grained scopes enable least-privilege access
- Store tokens securely: HTTP-only secure cookies for web apps, secure storage APIs for mobile, and encrypted credential stores for server-side services
- Treat refresh tokens as highly sensitive credentials; bind them to the client, rotate on use, and set reasonable absolute expiration times
Techniques
- Implement Authorization Code + PKCE: generate a random code_verifier, derive code_challenge via S256, send the challenge in the authorize request, and send the verifier in the token exchange
- Use Client Credentials flow for server-to-server authentication where no user context is needed; scope the resulting token narrowly
- Configure token refresh with sliding window expiration: issue short-lived access tokens (5-15 minutes) with longer refresh tokens (hours to days), rotating the refresh token on each use
- Implement OIDC by requesting the openid scope; validate the id_token signature and claims, then use the userinfo endpoint for additional profile data
- Set up the Backend-for-Frontend (BFF) pattern for SPAs: the BFF server handles the OAuth flow and stores tokens in HTTP-only cookies, keeping tokens out of JavaScript entirely
- Implement token revocation by calling the revocation endpoint on logout and maintaining a server-side deny list for JWTs that must be invalidated before expiration
Common Patterns
- Multi-tenant Identity: Use the issuer and tenant claims to route token validation to the correct identity provider, supporting customers who bring their own IdP
- Step-up Authentication: Request additional authentication factors (MFA) when accessing sensitive operations by checking the acr claim and initiating a new auth flow if insufficient
- Token Exchange: Use the OAuth 2.0 Token Exchange (RFC 8693) for service-to-service delegation, allowing a backend to obtain a narrowly-scoped token on behalf of the original user
- Device Authorization Flow: For input-constrained devices (TVs, CLI tools), use the device code grant where the user authorizes on a separate device with a browser
Pitfalls to Avoid
- Do not store access tokens or refresh tokens in localStorage; they are vulnerable to XSS attacks and accessible to any JavaScript on the page
- Do not skip the state parameter in authorization requests; it prevents CSRF attacks by binding the request to the user session
- Do not accept tokens without validating the audience claim; a token issued for one API should not be accepted by a different API
- Do not implement custom cryptographic token formats; use well-tested JWT libraries and standard OAuth/OIDC specifications
자주 묻는 질문
PKCE란 무엇인가요?
로그인 코드 교환을 보호하는 추가 단계이며, 단일 페이지 앱 같은 공개 앱에 스킬이 필수로 요구합니다.
JWT 검증은 무엇을 확인하나요?
토큰을 신뢰하기 전에 서명 알고리즘, 발급자, 대상, 만료 시간, 사용 전 시간을 확인하라고 스킬은 말합니다.
암시적 흐름은 아직 권장되나요?
아니요. 스킬은 암시적 흐름이 더 이상 권장되지 않으며 안전하지 않다고 말합니다.
상세 정보
작성자의 원본 설명
OAuth 2.0 and OpenID Connect expert for authorization flows, PKCE, and token management
repo: RightNow-AI/openfang
인기도
- GitHub 스타
- 18k
- 순위
- #10695
- 라이선스
- Apache-2.0
- 업데이트
- 2026. 7. 2.
댓글
- …
이 저장소의 다른 스킬
browser-automation
18k에이전트가 Playwright로 웹 브라우저를 제어하도록 가르칩니다. CSS 선택자로 버튼, 양식, 링크를 찾습니다.
clip-hand-skill
18k에이전트가 영상 클립을 만들도록 돕습니다. 영상을 내려받고, 음성을 텍스트로 옮기고, 자막 파일을 만들고, ffmpeg로 클립을 자릅니다.
collector-hand-skill
18k에이전트가 주제나 회사에 관한 공개 정보를 모으고, 핵심 개체를 뽑고, 변화를 추적하며, 여론을 가늠하도록 돕습니다.
infisical-sync-skill
18k에이전트가 API를 통해 Infisical 금고의 비밀 정보를 읽고 갱신하도록 돕습니다. 로그인 단계와 명확한 오류 처리를 포함합니다.