@riao/authn-oauth2-client-cred 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -73,6 +73,8 @@ const oauth2 = new UserOAuth2Authentication({
|
|
|
73
73
|
db: database,
|
|
74
74
|
jwtSecret,
|
|
75
75
|
tokenExpiresIn: 3600, // 1 hour
|
|
76
|
+
jwtIssuer: 'identity-service',
|
|
77
|
+
jwtAudience: 'my-api',
|
|
76
78
|
});
|
|
77
79
|
|
|
78
80
|
// Access principals via the inherited principalRepo property
|
|
@@ -82,6 +84,8 @@ const principal = await oauth2.principalRepo.findOne({
|
|
|
82
84
|
});
|
|
83
85
|
```
|
|
84
86
|
|
|
87
|
+
`jwtIssuer` and `jwtAudience` are optional non-empty strings. Configured values are included in newly issued tokens and enforced during verification; tokens with missing or different claims are rejected.
|
|
88
|
+
|
|
85
89
|
### 3. Create Client Credentials
|
|
86
90
|
|
|
87
91
|
```typescript
|
|
@@ -154,6 +158,11 @@ if (payload) {
|
|
|
154
158
|
|
|
155
159
|
## API Reference
|
|
156
160
|
|
|
161
|
+
### Access-token format migration
|
|
162
|
+
|
|
163
|
+
Signed access-token payloads must contain `token_type: 'access'` and non-empty
|
|
164
|
+
string `client_id` and `principal_id` claims.
|
|
165
|
+
|
|
157
166
|
### `generateSecret(length?)`
|
|
158
167
|
|
|
159
168
|
Generate a cryptographically secure random secret for client credentials.
|
|
@@ -199,7 +208,31 @@ Verify and decode a JWT access token.
|
|
|
199
208
|
**Parameters:**
|
|
200
209
|
- `token` (string) - JWT access token
|
|
201
210
|
|
|
202
|
-
**Returns:**
|
|
211
|
+
**Returns:** Verified payload with `client_id` and `principal_id`
|
|
212
|
+
if valid; `null` for invalid/expired tokens, revoked
|
|
213
|
+
credentials, or missing/inactive principals. The crypto helper removes
|
|
214
|
+
`iat`, `nbf`, and `exp` after verification.
|
|
215
|
+
|
|
216
|
+
### API bearer integration
|
|
217
|
+
|
|
218
|
+
Use API Machine 2's existing bearer scheme:
|
|
219
|
+
|
|
220
|
+
```typescript
|
|
221
|
+
import { BearerAuthenticationScheme } from 'api-machine';
|
|
222
|
+
|
|
223
|
+
const authentication = new BearerAuthenticationScheme({
|
|
224
|
+
checkToken: async (token) => {
|
|
225
|
+
const payload = await oauth2.verifyAccessToken(token);
|
|
226
|
+
if (!payload) {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return (await oauth2.findActivePrincipal({
|
|
231
|
+
where: { id: payload.principal_id },
|
|
232
|
+
})) ?? false;
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
```
|
|
203
236
|
|
|
204
237
|
### `createClientCredential(options)`
|
|
205
238
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* OAuth2 Client Credentials Authentication
|
|
3
3
|
*/
|
|
4
|
-
import { Jwt, JwtPayload } from '@riao/crypto';
|
|
4
|
+
import { Jwt, JwtPayload, JwtVerificationOptions } from '@riao/crypto';
|
|
5
5
|
import ms from 'ms';
|
|
6
6
|
import { DatabaseRecordId, QueryRepository } from '@riao/dbal';
|
|
7
7
|
import { Hash } from '@riao/crypto';
|
|
@@ -14,6 +14,7 @@ import { ClientCredential } from './client-credential';
|
|
|
14
14
|
export interface OAuth2TokenPayload extends JwtPayload {
|
|
15
15
|
client_id: string;
|
|
16
16
|
principal_id: string;
|
|
17
|
+
token_type: 'access';
|
|
17
18
|
}
|
|
18
19
|
export interface OAuth2ClientCredentialsOptions extends AuthenticationOptions {
|
|
19
20
|
hash?: Hash;
|
|
@@ -35,6 +36,8 @@ export interface OAuth2ClientCredentialsOptions extends AuthenticationOptions {
|
|
|
35
36
|
* Default: HS256
|
|
36
37
|
*/
|
|
37
38
|
jwtAlgorithm?: 'HS256' | 'HS512';
|
|
39
|
+
jwtIssuer?: string;
|
|
40
|
+
jwtAudience?: string;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* Options for creating a new client credential
|
|
@@ -64,6 +67,7 @@ export declare abstract class OAuth2ClientCredentialsAuthentication<TPrincipal e
|
|
|
64
67
|
protected tokenExpiresInSeconds: number;
|
|
65
68
|
protected readonly maxFailedAttempts: number;
|
|
66
69
|
protected readonly lockoutDurationMs: number;
|
|
70
|
+
protected readonly verificationOptions: JwtVerificationOptions;
|
|
67
71
|
constructor(options: OAuth2ClientCredentialsOptions);
|
|
68
72
|
/**
|
|
69
73
|
* Validate client_id format
|
|
@@ -126,5 +130,5 @@ export declare abstract class OAuth2ClientCredentialsAuthentication<TPrincipal e
|
|
|
126
130
|
authenticate(credentials: Partial<TPrincipal & {
|
|
127
131
|
client_id: string;
|
|
128
132
|
client_secret: string;
|
|
129
|
-
}>): Promise<TPrincipal | null>;
|
|
133
|
+
}> | null | undefined): Promise<TPrincipal | null>;
|
|
130
134
|
}
|
|
@@ -29,8 +29,18 @@ class OAuth2ClientCredentialsAuthentication extends authentication_1.Authenticat
|
|
|
29
29
|
tokenExpiresInSeconds;
|
|
30
30
|
maxFailedAttempts;
|
|
31
31
|
lockoutDurationMs;
|
|
32
|
+
verificationOptions;
|
|
32
33
|
constructor(options) {
|
|
33
34
|
super(options);
|
|
35
|
+
for (const claim of [options.jwtIssuer, options.jwtAudience]) {
|
|
36
|
+
if (claim !== undefined && !claim.trim()) {
|
|
37
|
+
throw new Error('JWT issuer and audience must be non-empty');
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
this.verificationOptions = {
|
|
41
|
+
issuer: options.jwtIssuer,
|
|
42
|
+
audience: options.jwtAudience,
|
|
43
|
+
};
|
|
34
44
|
this.hash = options.hash ?? new crypto_2.Hash();
|
|
35
45
|
this.maxFailedAttempts = Math.max(1, options.maxFailedAttempts ?? 5);
|
|
36
46
|
this.lockoutDurationMs = options.lockoutDurationMs ?? 15 * 60 * 1000;
|
|
@@ -135,11 +145,16 @@ class OAuth2ClientCredentialsAuthentication extends authentication_1.Authenticat
|
|
|
135
145
|
async exchangeCredentials(clientId, clientSecret) {
|
|
136
146
|
const attempt = {
|
|
137
147
|
scheme: 'oauth2-client-credentials',
|
|
138
|
-
subject: clientId,
|
|
148
|
+
subject: typeof clientId === 'string' ? clientId : '',
|
|
139
149
|
};
|
|
140
150
|
const protection = await this.beforeAuthenticationAttempt(attempt);
|
|
141
151
|
if (!protection.allowed) {
|
|
142
|
-
throw new
|
|
152
|
+
throw new authentication_1.AuthenticationBlockedError(protection.retryAfterSeconds);
|
|
153
|
+
}
|
|
154
|
+
if (typeof clientId !== 'string' || !clientId ||
|
|
155
|
+
typeof clientSecret !== 'string' || !clientSecret) {
|
|
156
|
+
await this.recordAuthenticationFailure(attempt);
|
|
157
|
+
throw new authentication_1.AuthenticationRejectedError('Invalid credentials');
|
|
143
158
|
}
|
|
144
159
|
// Find credential by client_id (active or revoked)
|
|
145
160
|
const credential = await this.credentialsRepo.findOne({
|
|
@@ -148,10 +163,11 @@ class OAuth2ClientCredentialsAuthentication extends authentication_1.Authenticat
|
|
|
148
163
|
// Distinguish between credential not found vs. revoked
|
|
149
164
|
if (!credential) {
|
|
150
165
|
await this.recordAuthenticationFailure(attempt);
|
|
151
|
-
throw new
|
|
166
|
+
throw new authentication_1.AuthenticationRejectedError('Invalid credentials');
|
|
152
167
|
}
|
|
153
168
|
if (credential.deactivate_timestamp !== null) {
|
|
154
|
-
|
|
169
|
+
await this.recordAuthenticationFailure(attempt);
|
|
170
|
+
throw new authentication_1.AuthenticationRejectedError('Credential has been revoked');
|
|
155
171
|
}
|
|
156
172
|
if (credential.locked_until &&
|
|
157
173
|
credential.locked_until <= new Date()) {
|
|
@@ -165,28 +181,35 @@ class OAuth2ClientCredentialsAuthentication extends authentication_1.Authenticat
|
|
|
165
181
|
}
|
|
166
182
|
else if (credential.locked_until &&
|
|
167
183
|
credential.locked_until > new Date()) {
|
|
168
|
-
throw new
|
|
184
|
+
throw new authentication_1.AuthenticationBlockedError(Math.ceil((credential.locked_until.getTime() - Date.now()) / 1000));
|
|
169
185
|
}
|
|
170
186
|
// Verify secret and track failed attempts
|
|
171
187
|
const isValid = await this.hash.check(clientSecret, credential.client_secret_hash);
|
|
172
188
|
if (!isValid) {
|
|
173
189
|
await this.recordAuthenticationFailure(attempt);
|
|
174
190
|
await this.recordExchangeFailure(credential);
|
|
175
|
-
throw new
|
|
191
|
+
throw new authentication_1.AuthenticationRejectedError('Invalid credentials');
|
|
176
192
|
}
|
|
177
193
|
// Get principal details
|
|
178
194
|
const principal = await this.findActivePrincipal({
|
|
179
195
|
where: { id: credential.principal_id },
|
|
180
196
|
});
|
|
181
197
|
if (!principal) {
|
|
182
|
-
|
|
198
|
+
await this.recordAuthenticationFailure(attempt);
|
|
199
|
+
throw new authentication_1.AuthenticationRejectedError('Principal not found');
|
|
183
200
|
}
|
|
184
201
|
// Generate JWT token using @riao/crypto
|
|
185
202
|
const payload = {
|
|
186
203
|
client_id: clientId,
|
|
187
204
|
principal_id: credential.principal_id,
|
|
205
|
+
token_type: 'access',
|
|
188
206
|
};
|
|
189
|
-
const tokenResult = await this.jwt.generateToken(payload
|
|
207
|
+
const tokenResult = await this.jwt.generateToken(payload, {
|
|
208
|
+
...(this.verificationOptions.issuer !== undefined
|
|
209
|
+
? { issuer: this.verificationOptions.issuer } : {}),
|
|
210
|
+
...(this.verificationOptions.audience !== undefined
|
|
211
|
+
? { audience: this.verificationOptions.audience } : {}),
|
|
212
|
+
});
|
|
190
213
|
// Update last exchange timestamp and reset failed attempts on success
|
|
191
214
|
await this.credentialsRepo.update({
|
|
192
215
|
set: {
|
|
@@ -238,11 +261,23 @@ class OAuth2ClientCredentialsAuthentication extends authentication_1.Authenticat
|
|
|
238
261
|
* @returns Token payload if valid, null if invalid or expired
|
|
239
262
|
*/
|
|
240
263
|
async verifyAccessToken(token) {
|
|
241
|
-
|
|
264
|
+
if (typeof token !== 'string' || !token) {
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
let payload;
|
|
242
268
|
try {
|
|
243
|
-
payload = await this.jwt.decodeToken(token);
|
|
269
|
+
payload = await this.jwt.decodeToken(token, this.verificationOptions);
|
|
244
270
|
}
|
|
245
271
|
catch (error) {
|
|
272
|
+
if ((0, crypto_1.isTokenValidationError)(error)) {
|
|
273
|
+
return null;
|
|
274
|
+
}
|
|
275
|
+
throw error;
|
|
276
|
+
}
|
|
277
|
+
if (typeof payload.client_id !== 'string' ||
|
|
278
|
+
!payload.client_id.trim() ||
|
|
279
|
+
typeof payload.principal_id !== 'string' ||
|
|
280
|
+
!payload.principal_id.trim() || payload.token_type !== 'access') {
|
|
246
281
|
return null;
|
|
247
282
|
}
|
|
248
283
|
// Verify credential is still active
|
|
@@ -314,7 +349,20 @@ class OAuth2ClientCredentialsAuthentication extends authentication_1.Authenticat
|
|
|
314
349
|
* (For compatibility with Authentication interface)
|
|
315
350
|
*/
|
|
316
351
|
async authenticate(credentials) {
|
|
317
|
-
const
|
|
352
|
+
const clientId = credentials && typeof credentials === 'object'
|
|
353
|
+
? credentials.client_id : undefined;
|
|
354
|
+
const clientSecret = credentials && typeof credentials === 'object'
|
|
355
|
+
? credentials.client_secret : undefined;
|
|
356
|
+
let token;
|
|
357
|
+
try {
|
|
358
|
+
token = await this.exchangeCredentials(typeof clientId === 'string' ? clientId : '', typeof clientSecret === 'string' ? clientSecret : '');
|
|
359
|
+
}
|
|
360
|
+
catch (error) {
|
|
361
|
+
if (error instanceof authentication_1.AuthenticationRejectedError) {
|
|
362
|
+
return null;
|
|
363
|
+
}
|
|
364
|
+
throw error;
|
|
365
|
+
}
|
|
318
366
|
const payload = await this.verifyAccessToken(token.access_token);
|
|
319
367
|
if (!payload) {
|
|
320
368
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2-client-credentials-authentication.js","sourceRoot":"","sources":["../../src/oauth2-client-credentials-authentication.ts"],"names":[],"mappings":";;;;AAAA;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"oauth2-client-credentials-authent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AM,KAAK,CAAC;QACb,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAEjE,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,OAAO,IAAI,CAAC;QACb,CAAC;QAED,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC;YAChD,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,YAAY,EAAgB;SACjD,CAAC,CAAC;QAEH,OAAO,SAAS,CAAC;IAClB,CAAC;CACD;AAhdD,sFAgdC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riao/authn-oauth2-client-cred",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "@riao/authn-oauth2-client-cred",
|
|
5
5
|
"typescript-template": {
|
|
6
6
|
"base": "1.0.1",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@riao/crypto": "^1.
|
|
12
|
+
"@riao/crypto": "^1.2.0",
|
|
13
13
|
"@riao/dbal": "^3.12.0",
|
|
14
|
-
"@riao/iam": "^
|
|
14
|
+
"@riao/iam": "^5.0.1",
|
|
15
15
|
"ms": "^2.1.3"
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|