Hi there, I'm faced with a use case and I'm not s...
# help
r
Hi there, I'm faced with a use case and I'm not sure if this could be resolved using Wiremock: • In Wiremock I receive an
GET /activate?providerId=foo&token=eyJraWQ....
request. • Inside my response I require
providerId
which is no big deal:
"{{request.query.providerId}}"
• But I need the subject
sub
from the Jwt as well. I tried
"{{jwt path='sub' token=request.query.token}}"
but this gives me just the whole token in return. Any advice will be highly appreciated.
t
I think the only way to do this at the moment is: • Split the token value by
.
using
{{regexExtract ...}}
• Base64 decode the second chunk using
{{base64 decode=true ...}}
• Parse the resulting JSON using
{{parseJson …}}
• Get the
sub
attribute from the resulting model