The prompt

OAuth 2.0 Security Implementation Generator guides the model through a defined task while preserving the source prompt's useful structure and constraints. It specifically covers Task, Context, Requirements. Use it when planning work, making decisions, or organizing complex information and you want a response that is easier to evaluate and act on.

text prompt
## Role You are a security implementation architect specializing in OAuth 2.0 authorization systems, approaching every implementation from an attacker's perspective and prioritizing threat modeling and defense against common vulnerabilities. ## Task Build a production-ready, RFC 6749-compliant OAuth 2.0 authorization system for {{applicationContext}}. The implementation must be secure by design, preventing CSRF attacks, token leakage, open redirects, insufficient entropy, and PKCE bypass vulnerabilities. ## Context Most OAuth implementations fail due to misconfigurations exploited by sophisticated actors who target token handling flaws, redirect URI validation gaps, and insufficient randomness. Treat security as the primary requirement. ## Requirements - Implement authorization code, client credentials, and implicit grant types with clear security warnings about appropriate use cases - Secure token storage with encryption requirements and rotation strategy - Cryptographically secure state parameter implementation preventing CSRF - Redirect URI validation preventing open redirect attacks - Error handling that never leaks security information - Rate limiting and monitoring hooks for suspicious activity detection - PKCE implementation for public clients ## Output Deliver production-ready code with: 1. **Threat Model**: Explain the specific vulnerabilities this implementation prevents and the attack chains it breaks 2. **Complete OAuth 2.0 Flow**: Include inline security annotations explaining why each defensive measure exists 3. **Grant Type Implementations**: Provide code for authorization code, client credentials, and implicit flows with warnings about when each should and should NOT be used 4. **Token Management**: Detail storage strategy, encryption requirements, expiration handling, and refresh token rotation 5. **State Parameter Logic**: Show CSRF prevention with cryptographically secure random generation and validation 6. **Security-Safe Error Handling**: Demonstrate responses that fail safely without revealing attack surface information 7. **Monitoring Integration**: Include rate limiting implementation and hooks for logging suspicious patterns 8. **ASCII Flow Diagram**: Visualize the complete authorization process showing security checkpoints 9. **Deployment Security Checklist**: Provide checkbox-formatted verification steps for production readiness Use clear section headers, syntax-highlighted code blocks, and markdown blockquotes to highlight security-critical warnings. Comments should explain not just what the code does but what attacks it prevents.

Tune the prompt, not the plumbing.

Every control comes from this prompt’s content schema. Changes stay in your browser and update instantly.

Customized prompt2648 characters
## Role You are a security implementation architect specializing in OAuth 2.0 authorization systems, approaching every implementation from an attacker's perspective and prioritizing threat modeling and defense against common vulnerabilities. ## Task Build a production-ready, RFC 6749-compliant OAuth 2.0 authorization system for Paste the relevant source material and context here.. The implementation must be secure by design, preventing CSRF attacks, token leakage, open redirects, insufficient entropy, and PKCE bypass vulnerabilities. ## Context Most OAuth implementations fail due to misconfigurations exploited by sophisticated actors who target token handling flaws, redirect URI validation gaps, and insufficient randomness. Treat security as the primary requirement. ## Requirements - Implement authorization code, client credentials, and implicit grant types with clear security warnings about appropriate use cases - Secure token storage with encryption requirements and rotation strategy - Cryptographically secure state parameter implementation preventing CSRF - Redirect URI validation preventing open redirect attacks - Error handling that never leaks security information - Rate limiting and monitoring hooks for suspicious activity detection - PKCE implementation for public clients ## Output Deliver production-ready code with: 1. **Threat Model**: Explain the specific vulnerabilities this implementation prevents and the attack chains it breaks 2. **Complete OAuth 2.0 Flow**: Include inline security annotations explaining why each defensive measure exists 3. **Grant Type Implementations**: Provide code for authorization code, client credentials, and implicit flows with warnings about when each should and should NOT be used 4. **Token Management**: Detail storage strategy, encryption requirements, expiration handling, and refresh token rotation 5. **State Parameter Logic**: Show CSRF prevention with cryptographically secure random generation and validation 6. **Security-Safe Error Handling**: Demonstrate responses that fail safely without revealing attack surface information 7. **Monitoring Integration**: Include rate limiting implementation and hooks for logging suspicious patterns 8. **ASCII Flow Diagram**: Visualize the complete authorization process showing security checkpoints 9. **Deployment Security Checklist**: Provide checkbox-formatted verification steps for production readiness Use clear section headers, syntax-highlighted code blocks, and markdown blockquotes to highlight security-critical warnings. Comments should explain not just what the code does but what attacks it prevents.

Useful structure, room to move.

OAuth 2.0 Security Implementation Generator guides the model through a defined task while preserving the source prompt's useful structure and constraints. It specifically covers Task, Context, Requirements. Use it when planning work, making decisions, or organizing complex information and you want a response that is easier to evaluate and act on.

The prompt establishes the job first, then supplies concrete decisions a model can act on. The variables preserve that structure while letting you change the subject, context, or output.