Skill files5 files

references/

scripts/

SKILL.md96 lines
1
---
2
name: oauth-implementation
3
description: >
4
Implement secure OAuth 2.0, OpenID Connect (OIDC), JWT authentication, and SSO
5
integration. Use when building secure authentication systems for web and
6
mobile applications.
7
---
8
9
# OAuth Implementation
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement industry-standard OAuth 2.0 and OpenID Connect authentication flows with JWT tokens, refresh tokens, and secure session management.
22
23
## When to Use
24
25
- User authentication systems
26
- Third-party API integration
27
- Single Sign-On (SSO) implementation
28
- Mobile app authentication
29
- Microservices security
30
- Social login integration
31
32
## Quick Start
33
34
Minimal working example:
35
36
```javascript
37
// oauth-server.js - Complete OAuth 2.0 implementation
38
const express = require("express");
39
const jwt = require("jsonwebtoken");
40
const crypto = require("crypto");
41
const bcrypt = require("bcrypt");
42
43
class OAuthServer {
44
constructor() {
45
this.app = express();
46
this.clients = new Map();
47
this.authorizationCodes = new Map();
48
this.refreshTokens = new Map();
49
this.accessTokens = new Map();
50
51
// JWT signing keys
52
this.privateKey = process.env.JWT_PRIVATE_KEY;
53
this.publicKey = process.env.JWT_PUBLIC_KEY;
54
55
this.setupRoutes();
56
}
57
58
// Register OAuth client
59
registerClient(clientId, clientSecret, redirectUris) {
60
this.clients.set(clientId, {
61
clientSecret: bcrypt.hashSync(clientSecret, 10),
62
// ... (see reference guides for full implementation)
63
```
64
65
## Reference Guides
66
67
Detailed implementations in the `references/` directory:
68
69
| Guide | Contents |
70
|---|---|
71
| [Node.js OAuth 2.0 Server](references/nodejs-oauth-20-server.md) | Node.js OAuth 2.0 Server |
72
| [Python OpenID Connect Implementation](references/python-openid-connect-implementation.md) | Python OpenID Connect Implementation |
73
| [Java Spring Security OAuth](references/java-spring-security-oauth.md) | Java Spring Security OAuth |
74
75
## Best Practices
76
77
### ✅ DO
78
79
- Use PKCE for public clients
80
- Implement token rotation
81
- Store tokens securely
82
- Use HTTPS everywhere
83
- Validate redirect URIs
84
- Implement rate limiting
85
- Use short-lived access tokens
86
- Log authentication events
87
88
### ❌ DON'T
89
90
- Store tokens in localStorage
91
- Use implicit flow
92
- Skip state parameter
93
- Expose client secrets
94
- Allow open redirects
95
- Use weak signing keys
96

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…