cancel
Showing results for 
Search instead for 
Did you mean: 

How to extract the access token from the 'Auth' tab and transfer it to the other requests in header?

SOLVED
Highlighted
Contributor

Re: How I can transfer the access Token from the 'Auth' tab to other requests in the header.

Hi @gquddus2013 

 

This post will help me to apply the authorization rules to all the requests, but this will not help me to create tokens at the same time. I will have to manually get the tokens every time.

 

Regards,

Jagruti Wani

Highlighted
Community Hero

Re: How to extract the access token from the 'Auth' tab and transfer it to the other requests in hea

Hi @Jagruuti,

Apologies for my late reply, i got sidetracked with some personal stuff.

Unless someone else has a nifty idea, i think you have 2 choices here. As the access token isn't available via a request/response's raw request/response content you need another option.
I tested a system that used OAuth v2.0 last year, but it had been customised so much that the embedded OAuth functionality in ReadyAPI! didn't work so i had to setup all the individual requests that comprise the back and forth that makes up the OAuth v2.0 auth which allowed me to do what you need to extract the access token to save it to a property. This option would allow you to do what you need, but it did take a lot of effort to automate the whole thing. Obviously i can understand how you wouldnt want to adopt this approach considering youve already got your OAuth setup already.

2nd option i can think of is if you raise a support call with Smartbear and see if they can advise how to extract the token value (its got to be persisted in a variable somewhere under the covers, right?) considering it doesnt look like anyone on the forum can help at this point....??

Sorry i cant be of more help,

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Contributor

Re: How to extract the access token from the 'Auth' tab and transfer it to the other requests in hea

Hi @richie,

 

Thank you so much for your reply!

One more thing, you have mentioned that you have set up all the individual requests that comprise the back and forth which helped you to extract the access token and save it in a property. How did you do that?

Though I have the OAuth setup already, I would like to automate the below steps sequentially.

1)The clicking of 'Get Access Token' Button

2) Entering the login credentials on the login page of application.

3) Extracting the verification code from outlook and entering on the next page after login.

4) Extracting the access token and adding it in the header.

 

And yes I will try the second option too.

 

Regards,

Jagruuti

Highlighted
Community Manager

Re: How to extract the access token from the 'Auth' tab and transfer it to the other requests in hea

Hi @Jagruuti , I see you are working with the Support Team on this - please let us know when you get the solution! Thank you.


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Contributor

Re: How to extract the access token from the 'Auth' tab and transfer it to the other requests in hea

Hi @sonya_m ,

 

I have still not got the solution. I will post it once I get the solution from the Support team or from some of the findings.

 

Thanks and Regards,

Jagruuti

Contributor

Re: How to extract the access token from the 'Auth' tab and transfer it to the other requests in hea

Hi @sonya_m,

 

Support Team has provided with the answer 🙂

 

While using OAuth 2 flow, you need to select the checkbox of 'Use Authorization Header' as shown in the attached screenshot. Then, you don't need to add the token in the Headers tab Ex. Authorization: Bearer [Access Token].  After that, you can use the Auth Manager and select the respective OAuth 2 profile for your requests.

 

Thank you,

Jagruuti

 

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors