Skip to main content

implement-oauth-login

Implement standards-based federated login with validated identity claims, protected redirects, and safe account linking. Use when an application must authenticate people through an external identity provider.

来源信息

仓库
protosphinx/sphinxstack
最近来源活动
2026年7月29日 13:55
检测到的 SKILL.md 语言
英语
星标
3
Forks
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
implement-oauth-login
category
code
description
Implement standards-based federated login with validated identity claims, protected redirects, and safe account linking. Use when an application must authenticate people through an external identity provider.
# implement-oauth-login Use OpenID Connect for authentication and keep the authorization-code exchange on a trusted server boundary. ## Procedure 1. Confirm whether the need is authentication, delegated API authorization, or both; use OpenID Connect for identity. 2. Register exact redirect URLs, trusted origins, logout behavior, and minimal scopes for each environment. 3. Load provider discovery metadata and pin the expected issuer and supported algorithms. 4. Start an authorization-code flow with one-time `state`, `nonce`, and PKCE values bound to the browser session. 5. Exchange the code through a confidential server path and never expose a client secret to browser code. 6. Validate signature, issuer, audience, nonce, expiration, authorized party, and required claims before trusting identity. 7. Link accounts through a verified, explicit policy rather than matching unverified email text alone. 8. Issue the application's own rotated session and store provider tokens only when a documented API use requires them. 9. Handle denial, expiry, replay, provider outage, revoked consent, logout, and key rotation with safe user messages. 10. Test successful and hostile flows against a provider sandbox and record the configuration. ## Guardrails - Never treat an access token as proof of identity without the protocol's required validation. - Do not accept arbitrary return URLs or dynamically weaken redirect matching. - Avoid automatic account linking when the provider's identifier or verification status is ambiguous. ## Done - Provider registration and identity-claim policy are documented - Login, denial, replay, linking, logout, and key-rotation cases are tested - Issued application sessions reconcile with verified provider events and audit logs
在 GitHub 查看