You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Andrew Ahr <an...@dteenergy.com> on 2022/12/15 18:37:23 UTC

HTTP Request continually gets a 401

Thread Group

HTTP Request
[cid:image003.png@01D91076.DC08F460]
[cid:image002.png@01D91076.4852EDC0]
JSON EXTRACTOR

REGULAR EXPRESSION EXREACTOR
[cid:image001.png@01D91077.43036970]
[cid:image004.png@01D91077.43036970]
HTTP REQUEST TO CALL AZURE FUNCTION with JSON EXRACTER
HTTP REQUEST TO CALL AZURE FUNCTION with JSON Extract returning the bearer token
[cid:image005.png@01D91078.2B86E140]
[cid:image006.png@01D91078.2B86E140]
AZURE DURABLE FUNCTION RESULT

[cid:image007.png@01D91079.95FE52A0]


What am I doing wrong that I cannot get the second call to execute without a 401

Andrew Ahr | Senior Consultant II
Neudesic, an IBM company - Trusted Technology Partner in Business Innovation
Mail: Andrew.ahr@neudesic.com<ma...@neudesic.com>
Mobile: 720.202.9866


Re: HTTP Request continually gets a 401

Posted by JOHN MELOM <jr...@comcast.net>.
Andrew,

Are you sure your syntax is correct for the second request?

I have always seen bearer tokens passed as part of an Authorization header, not as a request argument.

John

>     On 12/15/2022 12:37 PM Andrew Ahr <an...@dteenergy.com> wrote:
> 
> 
> 
>     Thread Group
> 
> 
>     HTTP Request
> 
>     JSON EXTRACTOR
> 
> 
>     REGULAR EXPRESSION EXREACTOR
> 
>     HTTP REQUEST TO CALL AZURE FUNCTION with JSON EXRACTER
> 
>     HTTP REQUEST TO CALL AZURE FUNCTION with JSON Extract returning the bearer token
> 
>     AZURE DURABLE FUNCTION RESULT
> 
> 
> 
> 
>     What am I doing wrong that I cannot get the second call to execute without a 401
> 
>      
> 
>     Andrew Ahr | Senior Consultant II
> 
>     Neudesic, an IBM company – Trusted Technology Partner in Business Innovation
> 
>     Mail: Andrew.ahr@neudesic.com mailto:Andrew.ahr@neudesic.com
> 
>     Mobile: 720.202.9866
> 
> 

Re: HTTP Request continually gets a 401

Posted by Dmitri T <gl...@live.com>.
Andrew Ahr wrote:
>
> *Thread Group*
>
> 	
>
> *HTTP Request*
>
> 	
>
> *JSON EXTRACTOR*
>
> 	
>
> *REGULAR EXPRESSION EXREACTOR*
>
> **
>
> 	
>
> **
>
> *HTTP REQUEST TO CALL AZURE FUNCTION with JSON EXRACTER*
>
> 	
>
> *HTTP REQUEST TO CALL AZURE FUNCTION with JSON Extract returning the 
> bearer token*
>
> **
>
> 	
>
> *AZURE DURABLE FUNCTION RESULT*
>
> 	
>
> **
>
> 	
>
> What am I doing wrong that I cannot get the second call to execute 
> without a 401
>
> **
>
> *Andrew Ahr*| Senior Consultant II
>
> *Neudesic, an IBM company *– Trusted Technology Partner in Business 
> Innovation
>
> *_Mail_*_:_***Andrew.ahr@neudesic.com* <ma...@neudesic.com>
>
> *Mobile*: 720.202.9866
>
Most probably you need to add a HTTP Header Manager 
<https://www.blazemeter.com/blog/http-header-manager> and configure it 
to send Authorization 
<https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization> 
header with the value of *Bearer ${bearerToken}

*If I'm wrong and you function expects the authorization context to be 
passed in the request parameters - tick "URL Encode" box in the HTTP 
Request sampler as your token contains special characters which need to 
be properly encoded <https://www.w3schools.com/tags/ref_urlencode.ASP>
**

Re: HTTP Request continually gets a 401

Posted by Jun Zhuang <th...@yahoo.com.INVALID>.
 You might want to check your JSON path. It should start with $. (with the dot). When you view result tree, you can test your JSON path on the response and see if that's correct.

    On Thursday, December 15, 2022 at 01:37:46 PM EST, Andrew Ahr <an...@dteenergy.com> wrote:  
 
  <!--#yiv7431004950 filtered {}#yiv7431004950 filtered {}#yiv7431004950 filtered {}#yiv7431004950 p.yiv7431004950MsoNormal, #yiv7431004950 li.yiv7431004950MsoNormal, #yiv7431004950 div.yiv7431004950MsoNormal {margin:0in;font-size:11.0pt;font-family:"Calibri", sans-serif;}#yiv7431004950 a:link, #yiv7431004950 span.yiv7431004950MsoHyperlink {color:#0563C1;text-decoration:underline;}#yiv7431004950 span.yiv7431004950EmailStyle18 {font-family:"Calibri", sans-serif;color:windowtext;}#yiv7431004950 .yiv7431004950MsoChpDefault {font-size:10.0pt;font-family:"Calibri", sans-serif;}#yiv7431004950 filtered {}#yiv7431004950 div.yiv7431004950WordSection1 {}-->
| 
Thread Group
 
  
  | 
HTTP Request
  |
| 

  | 

  |
| 
JSON EXTRACTOR
 
  
  | 
REGULAR EXPRESSION EXREACTOR
  |
| 

  | 

  |
| 
HTTP REQUEST TO CALL AZURE FUNCTION with JSON EXRACTER
  | 
HTTP REQUEST TO CALL AZURE FUNCTION with JSON Extract returning the bearer token
  |
| 

  | 

  |
| 
AZURE DURABLE FUNCTION RESULT
  | 
  
  |
| 

  | 
  
  |


  
 
What am I doing wrong that I cannot get the second call to execute without a 401
 
  
 
Andrew Ahr| Senior Consultant II
 
Neudesic, an IBM company – Trusted Technology Partner in Business Innovation
 
Mail:Andrew.ahr@neudesic.com
 
Mobile:720.202.9866