Releases: xeedware/cognito-jwt
Added "token_use" getter. Updated devDependencies.
- Added
token_use
getter toCognitoAccessToken
andCognitoIdToken
classes. - Deprecated
tokenUse
getter fromCognitoAccessToken
andCognitoIdToken
classes. - Updated package.json
devDependencies
:- @types/mocha: ^5.2.7 > ^7.0.2
- @types/node: ^10.17.17 > ^12.12.31
- aws-sdk: ^2.644.0 > ^2.647.0
- mocha: ^5.2.0 > ^7.1.1
- tslint: ^5.20.1 > ^6.1.0
Allow token verification
Replaced dependency on jwt-decode
with jsonwebtoken
to allow token validation.
-
Constructor Enhancements:
- Added
pem
parameter for token verification with a JSON Web Key (JWT). - Added
options
parameter (typically used for testing).
- Added
-
New Methods:
-
Payload related
Currently the getPayload() method returns an object.
The following new methods return their appropriate type:
-AccessToken
class,getAccessTokenPayload()
returnsAccessTokenPayload
.
-IdToken
class,getIdTokenPayload()
returnsIdTokenPayload
.
-CognitoAccessToken
class,getCognitoAccessTokenPayload()
returnsCognitoAccessTokenPayload
.
-CognitoIdToken
class,getCognitoIdTokenPayload()
returnsCognitoIdTokenPayload
. -
Get arbitrary property value
If the specified property exists,getPropertyValue(propertyName: string)
returns its value; otherwiseundefined
. -
Header and Signaure
getHeader()
returns the decoded JWT header.getSignature()
returns the decoded JWT signature.
-
Additional Cognito claims for CognitoIdToken and CognitoAccessToken
Added Claims:
-
CognitoIdToken class:
- cognito:groups
- device_key
- event_id
-
CognitoAccessToken class:
- cognito:groups
- event_id
Initial Release with correct package.json.
This is the initial release that has the correct package.json.