diff --git a/package.json b/package.json index e5154baf..5b771bdc 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "eth-ens-namehash": "^2.0.8", "ethers": "^5.4.4", "js-sha3": "^0.8.0", + "jsonwebtoken": "^8.5.1", "lodash.difference": "^4.5.0", "nats.ws": "^1.3.0", "qs": "^6.9.4", diff --git a/src/iam.ts b/src/iam.ts index 0d6a908a..ad7452b6 100644 --- a/src/iam.ts +++ b/src/iam.ts @@ -15,7 +15,7 @@ // @authors: Kim Honoridez // @authors: Daniel Wojno -import { providers, Signer, utils, Wallet } from "ethers"; +import { providers, Signer, utils } from "ethers"; import { IRoleDefinition, IAppDefinition, @@ -71,7 +71,7 @@ import { addressOf } from "@ew-did-registry/did-ethr-resolver"; import { isValidDID, parseDID } from "./utils/did"; import { chainConfigs } from "./iam/chainConfig"; import { canonizeSig } from "./utils/enrollment"; -import { JWT } from "@ew-did-registry/jwt"; +import jwt from "jsonwebtoken"; const { id, keccak256, defaultAbiCoder, solidityKeccak256, arrayify, namehash } = utils; export type InitializeData = { @@ -577,8 +577,7 @@ export class IAM extends IAMBase { blockNumber, }, }; - const jwt = new JWT(new Wallet(delegateKey)); - const identityToken = jwt.sign(payload, { algorithm: "ES256" }); + const identityToken = jwt.sign(payload, delegateKey); return identityToken; }