Commit ec457ca
committed
feat(M13-003): Implement refresh tokens with rotation and revocation
Implements OAuth2 refresh tokens following RFC 6749 with security best
practices:
- RefreshToken entity with TokenFamilyId for chain tracking
- Token rotation: old token revoked, new one issued on each use
- Token reuse detection: entire family revoked on reuse attempt
- Revocation endpoint following RFC 7009
- Audit logging for token issuance, rotation, and revocation events
Key features:
- SHA-256 hashed token storage
- "octr_" prefix for easy identification
- Configurable token lifetime (default: 30 days)
- Support for both public and confidential clients
- Scope preservation across token refresh1 parent 8cfde2d commit ec457ca
File tree
11 files changed
+2743
-39
lines changed- src
- Octopus.Server.App
- Auth
- Endpoints
- Octopus.Server.Contracts
- Octopus.Server.Domain
- Entities
- Enums
- Octopus.Server.Persistence.EfCore
- Configurations
- Migrations
- tests/Octopus.Server.App.Tests/Endpoints
11 files changed
+2743
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
72 | 77 | | |
73 | 78 | | |
74 | 79 | | |
75 | 80 | | |
76 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
77 | 87 | | |
78 | 88 | | |
79 | 89 | | |
| |||
89 | 99 | | |
90 | 100 | | |
91 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
92 | 112 | | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
96 | 121 | | |
97 | 122 | | |
98 | 123 | | |
| |||
120 | 145 | | |
121 | 146 | | |
122 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
123 | 152 | | |
124 | 153 | | |
125 | 154 | | |
| |||
164 | 193 | | |
165 | 194 | | |
166 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
167 | 219 | | |
168 | 220 | | |
169 | 221 | | |
| |||
243 | 295 | | |
244 | 296 | | |
245 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
246 | 303 | | |
0 commit comments