How to use the atlassian-jwt.fromMethodAndUrl function in atlassian-jwt

To help you get started, we’ve selected a few atlassian-jwt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mtmendonca / ace-boilerplate / api / src / services / JiraClient.js View on Github external
getToken = (method: string = 'get', path: string, iss: string, sharedSecret: string): Promise => {
    const iat = Math.floor(Date.now() / 1000);
    const exp = iat + 180;
    const req: Request = fromMethodAndUrl(method, path);
    const tokenData = {
      iss,
      iat,
      exp,
      qsh: createQueryStringHash(req),
    };

    const token = encode(tokenData, sharedSecret);
    return token;
  };

atlassian-jwt

JWT (JSON Web Token) implementation with custom Atlassian QSH claim verification

MIT
Latest version published 5 months ago

Package Health Score

65 / 100
Full package analysis