https://linen.dev logo
#help
Title
# help
e

Emil Fjellstroem

09/06/2023, 9:17 AM
Morning, I’m using the standalone version of Wiremock and I’m trying to use the response-template for
JWT
. My json looks like this 👇
Copy code
{
  "request": {
    "method": "POST",
    "urlPattern": "/oauth/token"
  },
  "response": {
    "status": 200,
    "transformers": [
      "response-template"
    ],
    "body": "{{{jwt sub='jonsmith'}}}"
  }
}
But I’m receiving a 500 👇
Copy code
Error 500 wiremock.com.google.common.util.concurrent.UncheckedExecutionException:
		wiremock.com.github.jknack.handlebars.HandlebarsException: inline@10512a5a:1:3: could not find helper:
		'jwt'
		{{{jwt sub='jonsmith'}}}
		^
Is the jwt function only available on cloud? Thanks, Emil
o

Oleg Nenashev

09/06/2023, 9:30 AM
Yes, it looks like so after looking into the code. For WireMock open source, there is an extension https://github.com/MasonM/wiremock-jwt-extension you may try, but its response templating syntax is different
e

Emil Fjellstroem

09/06/2023, 9:33 AM
I might be wrong here but this only extracts the contents of the jwt and doesn’t create one like what I’d assume this does? https://docs.wiremock.io/response-templating/jwt/
2 Views