name: oauth description: OAuth 2.0/OIDC 流程、提供商集成和令牌处理。 allowed-tools: Read, Write, Edit, Bash, Glob, Grep
OAuth 技能
为 OAuth 2.0 和 OpenID Connect 实现提供专家协助。
能力
- 实现 OAuth 流程
- 集成提供商(Google, GitHub)
- 处理 PKCE
- 管理令牌
- 配置 OIDC
OAuth 流程
// 带 PKCE 的授权码流程
const codeVerifier = generateCodeVerifier();
const codeChallenge = await generateCodeChallenge(codeVerifier);
const authUrl = new URL('https://provider.com/authorize');
authUrl.searchParams.set('client_id', CLIENT_ID);
authUrl.searchParams.set('redirect_uri', REDIRECT_URI);
authUrl.searchParams.set('response_type', 'code');
authUrl.searchParams.set('scope', 'openid profile email');
authUrl.searchParams.set('code_challenge', codeChallenge);
authUrl.searchParams.set('code_challenge_method', 'S256');
目标流程
- oauth-集成
- 社交登录
- 单点登录实现