Ask a Question

Auth Token is not getting refreshed due to which API is getting failed with error 401

Jainsoumya
Contributor

Auth Token is not getting refreshed due to which API is getting failed with error 401

Hi @richie

 

Auth Token is not getting refreshed automatically though I have ticked the checbox in settings too

and due to which I have to intervene manually and update the token 

Please refer the screenshot for the same 

19 REPLIES 19
richie
Community Hero

Hey @Jainsoumya 

 

It's been several years since I did anything wiht OAuth and that was when you had to use a script to do the auto refresh, so I don't think I'll be much help here.

 

HOWEVER - the token refresh options appear pretty straightforward.

 

Rather than use the "no expiration" radio button - have you played around with the custom option?

 

Cheers,

 

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

@richie  Yes , I have tried all the option available there, but no luck .

 

@sonya_m Can you please help me with this

@richie  while trying to automate the script for oauth token I am getting an error :

The following script failed: ko.dataFor(document.getElementById('i0116')).usernameTextbox.value('john.smith@hotmail.com'); document.getElementById('idSIButton9').click()

Error: Uncaught TypeError: Cannot read property 'usernameTextbox' of undefined]

 

 

For reference I am using this doc :https://support.smartbear.com/readyapi/docs/requests/auth/types/oauth2/automate/azure-sample.html

Hey @Jainsoumya,

I havent got an OAuth project to try and play with it, but if you've played with the options (and lets face it, its not overly complicated functionality) im leaning towards raising a support ticket to see if Smartbear can sort it for you as youve exhausted all options.

The ReadyAPI support ticket page is here -->> https://support.smartbear.com/readyapi/message/

Cheers,

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
mkrausem
Occasional Contributor

Hi @Jainsoumya ,

 

we are using a Submitlistener Script to get new tokens. With the options it worked not for us too.

 

Kind Regards, Michael

Michael Krausemann
sonya_m
SmartBear Alumni (Retired)

Thank you mkrausem and richie 

 

Hi @Jainsoumya, please review the recent suggestions from the Community, if none of them help, I recommend opening a support ticket - this issue might require a deeper investigation in this case. Thank you!


Sonya Mihaljova
Community and Education Specialist

@mkrausem Hi 

I have tried the script

but I am getting an error Uncaught TypeError: Cannot read property 'usernameTextbox' of undefined]

Login page is of microsoft , so I am not sure what m missing

I have raised the incident for the same waiting for reply

ko.dataFor(document.getElementById('i0116')).usernameTextbox.value= ("soumya.jain@strategy-compass.com");

document.getElementById('idSIButton9').click();

Hey @Jainsoumya 

 

When you get a response from SmartBear regarding the support ticket - would you mind publishing the results please?

 

Refreshing the OAuth token has always been problematic, so I'd be interested to see a solution.

 

I do know someone put a script together that actually worked and posted the solution - I'll have a search and see if I can find it.

 

that's all I got for now I'm afraid!

 

Cheers,

 

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

Hey @richie 

Sure !! I'll do that

cancel
Showing results for 
Search instead for 
Did you mean: