ReadyAPI: Using automated Authorization from Auth Repository
Hi all ( TanyaYatskovska Nastya_Khovrina nmrao ....)
I've tried to use Auhtorization OAuth 2.0 to set it in Auth Repository level to be able to use this in a different projects but the automations doesn't seem to work.
On Auth Repository I've added a OAuth 2.0 profile. The Get Access Token has an OAuth 2 Flow = Client Credentials Grant. Client identification and client secret are filled in, Access Token URL is pointing to our access token URL. When I click the 'Get Access Token" the token is generated successfully.
I've saved this.
I've created 2 environments (TA and INT) that I initiated with Authorization Profile AdminV2.0 as per created on Auth Repository. The environments are set on 'Inherit from parent' automatically when I select my profile.
But, when I close ReadyAPI at evening and re-open in the morning I notice that I've lost the token value as it only substains for 3000sec. Not a problem, though I would like to automate it to check on startup that the token is still valid.
So In the documentation on SmartBear I saw the automation code for webbased authentication. My URL is not really a webpage. I get response from our server by forward proxy in the form of a webpage. It's just a page with data. But the only 'login' that is necessary is not a password and login name but the token generated at Auth Report level.
Does someone know how to write that script that I can put in the [ Auth Repository > Profile created > Automation scripts ] ?
Or isn't that the way to automate the token to use in all projects?
Thanks in advance for reading this, I hope I was a little clear...
Cheers, AAB