Skip to content

Releases: xeedware/cognito-jwt

Added "token_use" getter. Updated devDependencies.

27 Mar 15:31
Compare
Choose a tag to compare
  • Added token_use getter to CognitoAccessToken and CognitoIdToken classes.
  • Deprecated tokenUse getter from CognitoAccessToken and CognitoIdToken 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

26 Mar 19:45
Compare
Choose a tag to compare

Replaced dependency on jwt-decode with jsonwebtoken to allow token validation.

  1. Constructor Enhancements:

    • Added pem parameter for token verification with a JSON Web Key (JWT).
    • Added options parameter (typically used for testing).
  2. New Methods:

    1. Payload related
      Currently the getPayload() method returns an object.
      The following new methods return their appropriate type:
      - AccessToken class, getAccessTokenPayload() returns AccessTokenPayload.
      - IdToken class, getIdTokenPayload() returns IdTokenPayload.
      - CognitoAccessToken class, getCognitoAccessTokenPayload() returns CognitoAccessTokenPayload.
      - CognitoIdToken class, getCognitoIdTokenPayload() returns CognitoIdTokenPayload.

    2. Get arbitrary property value
      If the specified property exists, getPropertyValue(propertyName: string) returns its value; otherwise undefined.

    3. Header and Signaure

      • getHeader() returns the decoded JWT header.
      • getSignature() returns the decoded JWT signature.

Additional Cognito claims for CognitoIdToken and CognitoAccessToken

26 Mar 19:32
Compare
Choose a tag to compare

Added Claims:

  • CognitoIdToken class:

    • cognito:groups
    • device_key
    • event_id
  • CognitoAccessToken class:

    • cognito:groups
    • event_id

Initial Release with correct package.json.

26 Mar 19:24
Compare
Choose a tag to compare

This is the initial release that has the correct package.json.