Hunter Marshall
Hunter Marshall

Reputation: 211

Performance testing using JMeter script on an OAuth 2.0 Secure Web Application

I used BlazeMeter's chrome extension to build a .jmx file for testing our login page in JMeter. Most of our application is written in node js. We are using Auth0 for our login and the /login/callback is giving me a 400. I am not sure why. My goal is to test our applications with about 200 users. Any help would be great!

Results for /login/callback

What I have included

Upvotes: 3

Views: 3489

Answers (1)

Dmitri T
Dmitri T

Reputation: 168002

The HTTP 400 Bad Request response status code indicates that the server could not understand the request due to invalid syntax.

Most probably you are getting this error due to malformed request body or missing header, most probably you need to add a HTTP Header Manager and configure it to send Content-Type header with the value of application/json

Also be aware that OAuth authorization flow isn't something you will be able to record and replay, it is all about obtaining an Authorization Bearer token and sending it along with the requests requiring authorization via the aforementined HTTP Header Manager.

There are several ways of obtaining an OAuth token, check out How to Run Performance Tests on OAuth Secured Apps with JMeter guide for more details on bypassing OAuth login challenge in JMeter tests.

Upvotes: 1

Related Questions