Auth Token is not getting refreshed due to which API is getting failed with error 401
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
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?
@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('firstname.lastname@example.org'); 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
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/
Hi @Jainsoumya ,
we are using a Submitlistener Script to get new tokens. With the options it worked not for us too.
Kind Regards, Michael
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
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!