JMeter unable to fetch redirect url - url

my URL(https://www.test.com) has parameters
response_type,client_id,redirect_uri:https://wwwx.dummy.com, scope
When I paste my URL with params in chrome, I get the redirect URL as
https://wwwx.dummy.com?code=XXXXXXXXXXXXXXXXX
But in Jmeter I am unable to get this code parameter
Enabled debug post processor
capturing regular expression from URL (.*)
trying to post the redirect url in next http request
I dont see redirect url in any of the sub samples.
kindly help

Instead of using a 3rd-party website you can use a local address like http://localhost:8081/foo/bar as the redirect_uri so the request will go to your local JMeter instance instead of the remote website.
You can extract the code from the request's Location header using Regular Expression Extractor
If you don't want the sampler to fail you can use i.e. HTTP Mirror Server in order to "catch" the request.

Related

Convert curl command with --form-string to a URL

I have command (line-breaks added between command-line parameters for readability):
curl
-s
--form-string "token=AppToken"
--form-string "user=UserToken"
--form-string "message=Msg"
--form-string "title=Title"
https://api.pushover.net/1/messages.json
Can you tell me if this command can be converted into a URL link?
Can you tell me if this command can be converted into a url link?
It cannot.
That curl command is for a POST with an application/x-www-form-urlencoded request body.
"Links" are always GET requests and never for POST requests.
<a href="#"> links in HTML and the web can only make GET requests without a request-body (at least, not without custom JavaScript interception).
In desktop software frameworks and toolkits (that have built-in Hyperlink widgets), I find (in my personal experience) that they're similarly designed around the assumption they'll be used to open a URL to a web-page and so pass the URL to the user's default browser, which will only make a GET request.
This is because following a link (i.e. executing a GET request) must always be "safe" (i.e. GET requests should not mutate resource state).
Additionally, "Links" cannot have a request body.
Though while GET requests can (technically) have a request-body, support for that is not widespread; and obviously single URIs for hyperlink GET requests don't have any request-body data associated with them.
GET request bodies are intended to allow user-agents to make GET requests with associated request/query data that is too long to fit into the querystring of the URI (due to the common 1024 or 2048 char limit).

No "Location" header in JMeter for Auth 2.0

Auth 2.0.
"code" parameter is required to perform
POST /.../oauth2/v2.0/token
with code value.
In Fiddler code value could be found in Location header of response to /kmsi request:
However, here is no Location header in JMeter for the same request:
Why? Are there any tip to get Location header in JMeter too?
If you're seeing different response it means that
Either you're sending a different request. In this case inspect request details from JMeter and from the real browser using a 3rd-party sniffer tool like Fiddler or Burp, identify the inconsistencies and amend your JMeter configuration so it would send exactly the same request as the real browser does (apart from dynamic values which need to be correlated)
Or one of the previous requests fails somewhere somehow, JMeter automatically treats HTTP responses with status codes below 400 as successful, it might be the case they are not really successful, i.e. you're continuously hitting the login page (you can check it by inspecting response data tab of the View Results Tree listener). Try adding a Response Assertions to the HTTP Request samplers so there will be another layer of explicit checks of the response data, this way you will get confidence that JMeter is doing what it is supposed to be doing.

How print file in RestFull+Oauth

We create web project with RestFull+OAuth.
Its looks good - client sent token for each request in header Authorize.
But for some request we can`t add header.
For example when we print some image or document.
Because we use window.open - at our disposal only GET params.
At now i see one way - for that request add token to UPL as get params(?token=xxxxxxx) and not show url line in child browser window.
But i think its not good way.
Maybe somebody have other idea or practicals of implement it.
putting token in URL is not good way as it will be public in network and any one sniffing on your network will get the token, I think you have to make revers proxy on your server to get the file you want by after checking session attribute to be sure you are authorized for that.

Jmeter OAuth Plugin

I am using jmeter to perform some load testing. this particular test will record how long it takes to get a response from a web service using OAUTH.
I have added the Jmeter Oauth plugin, set up my keys, url and data to be posted etc, however I keep getting an error message within my report
Response code: Non HTTP response code: java.net.URISyntaxException
Response message: Non HTTP response message: Expected closing bracket for IPv6 address at index 14
Has anyone had this error before or does anyone have a good guide on how to use the OAUTH plugin?
Any help appreciated
when i get this error the problem was that i perfix the server name or ip
with http
so if you set server name or ip parameter with for example http://www.google.com you need
to replace it with www.google.co.il namely omit the http://
(you can set the protocol http in the protocol value of http request)

change POST url on the fly during HTTP request in Firefox

I would like to change url the HTTP POST to during the request in firefox. Currently I have tried "Tamper Data" firefox addon which allows me change POST parameters but not the POST request url during the request.
I don't want to mimic the post by curl etc as I have to manually setup the cookie and parameters all that.
Is there such thing available in firefox?
thanks!
Have a look at Live HTTP Headers addon.
There is a "Replay" button where you can alter URL and data of a previously recorded request.

Resources