src/client.js
/**
   * Generate a signed JWT used for authenticating 
   * @param {*} client_id The identifier of the client on the remote server
   * @param {*} aud The token url of the server the JWT is being created for
   * @param {*} kid The identifier of the key in the JWKS to sign the JWT
   */
Generate a signed JWT used for authenticating
@param {*} client_id The identifier of the client on the remote server
@param {*} aud The token url of the server the JWT is being created for
@param {*} kid The identifier of the key in the JWKS to sign the JWT
Generate a signed JWT used for authenticating @param { * } client_id The identifier of the client on the remote server @param { * } aud The token url of the server the JWT is being created for @param { * } kid The identifier of the key in the JWKS to sign the JWT
async generateJWT(client_id, aud, kid = this.signingKeyId) {
    let options = { alg: 'RS384', compact: true }
    let key = await this.getKeyOrDefault(kid)
    let input = JSON.stringify({
      sub: client_id,
      iss: client_id,
      aud: aud,
      exp: (Math.floor(Date.now() / 1000) + 300),
      jti: v4()
    })
    return await jose.JWS.createSign(options, key).
      update(input).
      final()
  }
async generateJWT ( client_id , aud , kid = this . signingKeyId ) { let options = { alg : 'RS384' , compact : true } let key = await this . getKeyOrDefault ( kid ) let input = JSON . stringify ( { sub : client_id , iss : client_id , aud : aud , exp : ( Math . floor ( Date . now ( ) / 1000 ) + 300 ) , jti : v4 ( ) } ) return await jose . JWS . createSign ( options , key ) . update ( input ) . final ( ) }
Generate a signed JWT used for authenticating
 @param {*} client_id The identifier of the client on the remote server
 @param {*} aud The token url of the server the JWT is being created for
 @param {*} kid The identifier of the key in the JWKS to sign the JWT
Generate a signed JWT used for authenticating @param { * } client_id The identifier of the client on the remote server @param { * } aud The token url of the server the JWT is being created for @param { * } kid The identifier of the key in the JWKS to sign the JWT