OAUTH2.0 Authentication token

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

OAUTH2.0 Authentication token

Ramkumar Selvaraj
Hi All,


I have a requirement to test performance for Rest web Api by creating a customer registration page.

Before creating a customer page, it requires to get the access token from the registered system called Azure Active directory AD Tenant system where the system is deployed.By getting the token from OAUTH 2.0 where I need to send the Authorization token in the Header Manager as a next request to  create the customer registration page.

I am not sure how to do this,anybody can share some ideas or steps how to proceed this through JMeter.


Please give me some inputs how to do this through JMeter.

Its an urgent requirement.


Thanks for the support


Cheers,

Ram

Reply | Threaded
Open this post in threaded view
|

Re: OAUTH2.0 Authentication token

glinius@live.com
This post has NOT been accepted by the mailing list yet.
I think you could use active-directory-java-native-headless from JSR223 PreProcessor in order to get the required token and store it into a JMeter Variable.

See How to Run Performance Tests on OAuth Secured Apps with JMeter to get familiarized with the OAuth concept and possible workaround
Reply | Threaded
Open this post in threaded view
|

RE: OAUTH2.0 Authentication token

derek kelly
In reply to this post by Ramkumar Selvaraj
The way I learned was watching YouTube videos.

I don't know OAuth specifically, but maybe I can steer you in the right direction.

You send your credentials to the authority
It responds with "keys", kind of like session IDs
You want to Add - Post Processors - Regular Expression Extractor
You designate where to look (body, response header, etc)
Reference Name is your variable name, which will be populated
Regular Expression is what to look for (creating that is part art, part science)
Template: I don't remember what this is.  I have $1$ in a sample, so I think it's what to grab based on the hit.
Match No you can leave blank for "grab the first hit"
Default Value: Put whatever you want the variable filled with when no hit is found.  I have "bad_data" in my sample.

You may need to grab multiple pieces of data so you can send those back in subsequent calls.

It's really useful to record once so you can look at the result tree and study what pieces of data are going back and forth.

-----Original Message-----
From: Ramkumar Selvaraj [mailto:[hidden email]]
Sent: Thursday, August 3, 2017 4:22 AM
To: JMeter Users List <[hidden email]>
Subject: OAUTH2.0 Authentication token

Hi All,


I have a requirement to test performance for Rest web Api by creating a customer registration page.

Before creating a customer page, it requires to get the access token from the registered system called Azure Active directory AD Tenant system where the system is deployed.By getting the token from OAUTH 2.0 where I need to send the Authorization token in the Header Manager as a next request to  create the customer registration page.

I am not sure how to do this,anybody can share some ideas or steps how to proceed this through JMeter.


Please give me some inputs how to do this through JMeter.

Its an urgent requirement.


Thanks for the support


Cheers,

Ram


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: OAUTH2.0 Authentication token

Sree Ranganath K
In reply to this post by Ramkumar Selvaraj
Hi Ram,

You can use Webdriver sampler to do the login process and capture the token
from the cookies or headers.
Remaining requests you can use HTTP Request Sampler and pass the token you
have captured.

--
S| " " " |R
R  ^  ^   A
E  '   '   N
E    '     G
      v    A
    \__/



>
> I have a requirement to test performance for Rest web Api by creating a
> customer registration page.
>
> Before creating a customer page, it requires to get the access token from
> the registered system called Azure Active directory AD Tenant system where
> the system is deployed.By getting the token from OAUTH 2.0 where I need to
> send the Authorization token in the Header Manager as a next request to
> create the customer registration page.
>
> I am not sure how to do this,anybody can share some ideas or steps how to
> proceed this through JMeter.
>
>
> Please give me some inputs how to do this through JMeter.
>
> Its an urgent requirement.
>
>
> Thanks for the support
>
>
> Cheers,
>
> Ram
>
>
Reply | Threaded
Open this post in threaded view
|

Re: OAUTH2.0 Authentication token

Ramkumar Selvaraj
In reply to this post by derek kelly
Hi Derek,


This is not the website to record and add the correlation, its a Rest API Post call.

I got a Post call endpoint url with some header information and Body data, sending those., but not returning any token.

I am not getting Access token from Jmeter only through postman I am getting the token.
I want to get the token in Jmeter to reuse for the next request by sending the token to create the registration page.

Thanks,
Ram



________________________________
From: derek kelly <[hidden email]>
Sent: Saturday, 5 August 2017 7:03 a.m.
To: JMeter Users List
Subject: RE: OAUTH2.0 Authentication token

The way I learned was watching YouTube videos.

I don't know OAuth specifically, but maybe I can steer you in the right direction.

You send your credentials to the authority
It responds with "keys", kind of like session IDs
You want to Add - Post Processors - Regular Expression Extractor
You designate where to look (body, response header, etc)
Reference Name is your variable name, which will be populated
Regular Expression is what to look for (creating that is part art, part science)
Template: I don't remember what this is.  I have $1$ in a sample, so I think it's what to grab based on the hit.
Match No you can leave blank for "grab the first hit"
Default Value: Put whatever you want the variable filled with when no hit is found.  I have "bad_data" in my sample.

You may need to grab multiple pieces of data so you can send those back in subsequent calls.

It's really useful to record once so you can look at the result tree and study what pieces of data are going back and forth.

-----Original Message-----
From: Ramkumar Selvaraj [mailto:[hidden email]]
Sent: Thursday, August 3, 2017 4:22 AM
To: JMeter Users List <[hidden email]>
Subject: OAUTH2.0 Authentication token

Hi All,


I have a requirement to test performance for Rest web Api by creating a customer registration page.

Before creating a customer page, it requires to get the access token from the registered system called Azure Active directory AD Tenant system where the system is deployed.By getting the token from OAUTH 2.0 where I need to send the Authorization token in the Header Manager as a next request to  create the customer registration page.

I am not sure how to do this,anybody can share some ideas or steps how to proceed this through JMeter.


Please give me some inputs how to do this through JMeter.

Its an urgent requirement.


Thanks for the support


Cheers,

Ram


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]