Forum Discussion

anagai's avatar
anagai
Occasional Contributor
5 years ago
Solved

Not automatically refreshing authorization access token

I have a test that retrieves authorization access token and I set it to automatically refresh after 1 second. Meaning I want it to to get access token for every time it is run. It is not refreshing the token. I just see an error sign saying token has expired. It is not auto refreshing. What is going on?

  • To clarify, would be great if this auto token refresh feature worked when using the 'Client Credentials Grant' method of getting the token.

     

    I can make an step that gets access token from our authorization server and put into a testsuite custom property. All the request steps will then use this token for their Authorization headers. This is alot simpler.

10 Replies

  • richie's avatar
    richie
    Community Hero
    Hey anagai,

    Im guessing before anyone can provide any help forum members will need to know a little more.

    Whats the authentication/authorization scheme youre using?
    Is it OAuth youre using? If yes, whats the grant type?
    Are you using the embedded OAuth functionality along with javascript to do what you need?
    If you have scripts can you post them so people can review?

    Ive seen over the last year a number of posts (via soapui/readyapi! forum and stackoverflow) cos people are having trouble automatically refreshing the token for OAuth v2.0....perhaps these previous posts might help you?

    Cheers

    Rich
    • anagai's avatar
      anagai
      Occasional Contributor

      I am using OAuth 2 - Client Credentials Grant. I have the settings correct and is retrieving the token. There is no javascript. Not authenticating on any page. I simply want the getting of a new token on every test for now, because I just want to see if that auto refresh feature even works. I have seen some of the post regarding this. For now I just want an explanation exactly how this feature works. The option says Refresh Access Token: Automatic and I set the expire to 1 second. I am to conclude that when token expires it will automatically get a new token without me having me to click on get token. This does not seem to be happening. Is this how it is supposed to work? I could not find a really clear explanation on the documentation. Maybe you can point me to a place where I can understand this feature.