@frontegg/client
Advanced tools
Comparing version 5.2.1 to 5.3.0-alpha.1
@@ -5,1 +5,4 @@ export * from './failed-to-authenticate.exception'; | ||
export * from './invalid-token-type.exception'; | ||
export * from './max-age-exceeded.exception'; | ||
export * from './missing-acr.exception'; | ||
export * from './missing-amr.exception'; |
@@ -21,2 +21,5 @@ "use strict"; | ||
__exportStar(require("./invalid-token-type.exception"), exports); | ||
__exportStar(require("./max-age-exceeded.exception"), exports); | ||
__exportStar(require("./missing-acr.exception"), exports); | ||
__exportStar(require("./missing-amr.exception"), exports); | ||
//# sourceMappingURL=index.js.map |
export * from './identity-client'; | ||
export * from './step-up'; |
@@ -18,2 +18,3 @@ "use strict"; | ||
__exportStar(require("./identity-client"), exports); | ||
__exportStar(require("./step-up"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -5,2 +5,3 @@ "use strict"; | ||
const types_1 = require("../types"); | ||
const step_up_1 = require("../step-up/"); | ||
const token_resolver_1 = require("./token-resolver"); | ||
@@ -17,2 +18,5 @@ class AuthorizationJWTResolver extends token_resolver_1.TokenResolver { | ||
} | ||
if (entity.type === types_1.tokenTypes.UserToken && (options === null || options === void 0 ? void 0 : options.stepUp)) { | ||
step_up_1.StepupValidator.validateStepUp(entity, typeof options.stepUp === 'boolean' ? {} : options.stepUp); | ||
} | ||
return entity; | ||
@@ -19,0 +23,0 @@ } |
@@ -0,1 +1,2 @@ | ||
import { IValidateStepupTokenOptions } from './step-up'; | ||
export declare enum AuthHeaderType { | ||
@@ -13,2 +14,3 @@ JWT = "JWT", | ||
withRolesAndPermissions?: boolean; | ||
stepUp?: boolean | IValidateStepupTokenOptions; | ||
} | ||
@@ -51,2 +53,5 @@ export declare enum tokenTypes { | ||
superUser?: true; | ||
amr?: string[]; | ||
acr?: string; | ||
auth_time?: number; | ||
}; | ||
@@ -53,0 +58,0 @@ export type IApiToken = IEntityWithRoles & { |
@@ -0,1 +1,8 @@ | ||
# [5.3.0-alpha.1](https://github.com/frontegg/nodejs-sdk/compare/5.2.1...5.3.0-alpha.1) (2023-11-28) | ||
### Features | ||
* **step-up:** add stepup validator ([#176](https://github.com/frontegg/nodejs-sdk/issues/176)) ([94559ae](https://github.com/frontegg/nodejs-sdk/commit/94559aef699d939dcc73771c7ba4b2ed5ecb332a)) | ||
## [5.2.1](https://github.com/frontegg/nodejs-sdk/compare/5.2.0...5.2.1) (2023-11-27) | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@frontegg/client", | ||
"version": "5.2.1", | ||
"version": "5.3.0-alpha.1", | ||
"description": "Frontegg Javascript Library for backend node servers", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -222,3 +222,16 @@ <br /> | ||
(see <a href="#validating-jwt-manually">Validating JWT manually</a> section for more details). | ||
#### step-up | ||
The client can be used to verify whether an authorized user has undergone step-up authentication. | ||
> You can also require session max age to determine a stepped up user | ||
```javascript | ||
// Validate the token and decode its properties for a stepped-up user | ||
const steppedUpUserEntity = await identityClient.validateToken(token, { stepUp: true }); | ||
// Validate the token with session maximum age requirement (up to one hour) for a stepped-up user | ||
const steppedUpUserEntityWithMaxAge = await identityClient.validateToken(token, { stepUp: { maxAge: 3600 } }); | ||
``` | ||
#### entitlements | ||
When the user/tenant entity is resolved, you can start querying the entitlements engine: | ||
@@ -225,0 +238,0 @@ ```javascript |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
230314
257
3079
332
0
7
1