score:2
Accepted answer
this is pretty much exactly what .transform is for. you extract the token with jsonpath, do a transform to get the sub, and then assert that it matches the username.
(i have not tried the actual jwt extract / validation)
.check(jsonpath("$.access_token").transform(jwt => jwt.decode(jwt).getclaim("sub").asstring()).is("${username}")
Source: stackoverflow.com
Related Query
- Gatling Verifying Decoded JWT token
- Gatling - decode JWT token and verify value in token
- Send Authorization Token | Gatling
- How to use a single OAuth2.0 token for Multiple Virtual Users in a Gatling load test
- How can I validate the HMAC signature of a JWT token in pure Scala?
- Read expiration date from jwt token
- Reaching JWT Token in play2 silhouette JWTAuthenticator
- Gatling token refresh heart beat
- How Silhouette JWT token keeps valid in stateless mode?
- How can save XSRF token from cookie and pass it to server in next request header in Gatling
- Why won't gatling post an auth token from a POST return body to a GET header
- Gatling Generate OAuth2.0 token using callback URL not working
- How to secure a Scala Play Endpoint with a JWT Token
- Auth token handling for Gatling
- Get token id from Login request in Gatling
- Gatling Scala:Unable to send auth token to the method using session variable
- JWT headers with Gatling Post Request
- Generate authentication token and use it throughout the session in Gatling
- Should I use the JWT token in the OAuth2 for Delivering a Secure API
- Gatling - Log body of request in simulation.log or console
- Modularising scenarios to run in sequence using Gatling
- How to debug/run a single gatling simulation in IntelliJ IDEA without sbt command?
- Play Framework & JSON Web Token
- How to pass along CSRF token in an AJAX post request for a form?
- Parsing a Json response returned to Gatling
- Gatling - Looping through JSON array
- Gatling configure base url in configuration file
- Alternative to Gatling
- How to bring jenkins job to fail when Gatling load tests underperform
- Verifying mocked object method calls with default arguments
More Query from same tag
- Scala convert model object to DTO
- Scala import statement at top and inside scala class
- create two immutable data structure in one go using scala for comprehension or any other feature
- Scala framework for a Rest API Server?
- What structures to use to create constant access time immutable table in Scala?
- An easy way to get rid of *everything* generated by SBT?
- How to modify jar name generate by cmd sbt package
- Play Framework 2.6 Alpakka S3 File Upload
- How to combine Kleisli[M, A, C] and Kleisli[M, B, C]
- Blob or BYTEA from Plain SQL Query in Slick 3.0.0
- Key Value List from File In Spark Scala
- Shapeless: batch update using Record
- Functor for scala.collection.Map[Int, T]
- How to run sbt multiple command in interactive mode as one command?
- Why is `contains` on collections not requiring the correct type?
- Group by and find count before doing pivot spark
- Scala higher-kinded types general factory
- Play framework: play.api.mvc.DefaultJWTCookieDataCodec decode: could not decode JWT: null
- First N columns in dataframe using PySpark
- Fold and foldLeft method difference
- Scala app on Heroku - Boot Timeout
- File filter not working in Spark StreamingContext.fileStream(...) API
- Using DATEPART into a Slick Query
- Stop the fs2-stream after a timeout
- Select substring between two characters in Scala
- Scala Type System Help: Let a failure cascade up the stack
- Check if a value is between two columns, spark scala
- Scala Algebraic Data Types for file extension to format mapping
- Initialize class member late
- How to extract the value of a cell from Future[ResultSet]?