Contributions
Re: Automatic OAuth 2.0 access token refresh not working
OK I fixed it by my own using a groovy script that executes before the REST request. This is not fixing the original problem that automatic access token refresh is not working, but ok. Learned a little more abour bearer token request and handling 🙂 import wslite.rest.RESTClient import groovy.json.JsonSlurper def url = "https://xxx/api/oauth/token" def c_id = "yyy" def c_secret = "zzz" def client = new RESTClient(url) def response = client.post() { type "application/x-www-form-urlencoded" urlenc grant_type:"client_credentials", client_id:c_id, client_secret:c_secret } log.info response.statusCode + " - " + response.statusMessage def slurper = new JsonSlurper() def json = slurper.parseText(response.getContentAsString()) log.info json.access_token return "Bearer " + json.access_token10 months agoPlace ReadyAPI QuestionsReadyAPI Questions315Views0likes0CommentsRe: How to use @grab in groovy scripts?
nmraoThank you. It is not solving the original problem loading dependencies dynamically via@Grab, but it works. It also proves that loading jar libs from /bin/ext/ folder is working. I guess the ivy lib needs an additional lib like ant to use@Grab command but I will not investigate further.10 months agoPlace ReadyAPI QuestionsReadyAPI Questions919Views0likes1CommentRe: How to use @grab in groovy scripts?
nmraoNo change. Groovy says unexpected input before@Grap (see error message) Wed Jul 05 13:40:44 CEST 2023: ERROR: An error occurred in the script of the Groovy Script test step [Groovy Script]: Wed Jul 05 13:40:44 CEST 2023: ERROR: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script9.groovy: 1: Unexpected input: '@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.2')' @ line 1, column 81. oovy-wslite', version='1.1.2')10 months agoPlace ReadyAPI QuestionsReadyAPI Questions789Views0likes0CommentsHow to use @grab in groovy scripts?
Hi! How can I extend groovy script functionality inside ReadyAPI? ReadyAPI version 3.47.0 with Groovy 3.0.14 installed. I already added latest Apache ivy dependency manager "ivy-2.5.1.jar" to "C:\Program Files\SmartBear\ReadyAPI-3.47.0\bin\ext", but grab command is not working: @Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.3') Wed Jul 05 13:21:28 CEST 2023: ERROR: An error occurred in the script of the Groovy Script test step [Groovy Script]: Wed Jul 05 13:21:28 CEST 2023: ERROR: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script6.groovy: 1: Unexpected input: '@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.3')' @ line 1, column 81. oovy-wslite', version='1.1.3') Thank you in advance! sp00kySolved10 months agoPlace ReadyAPI QuestionsReadyAPI Questions969Views0likes5CommentsAutomatic OAuth 2.0 access token refresh not working
Hi! Does anyone know how to get automatic OAuth 2.0 access token refresh working before doing a REST call? Grant_type is "client_credentials" with client_id and client_secret. Manual refresh after token is expired is working fine. Thank you in advance! Br sp00kySolved10 months agoPlace ReadyAPI QuestionsReadyAPI Questions349Views0likes1CommentRe: Automating OAuth 2.0 with Client credentials grant
Same problem for me... 1st simple question: Why OAuth 2.0 access token refresh is not working automatically in ReadyAPI 3.47.0? Only manual is working. In addition I also tried to add latest Apache ivy dependency manager "ivy-2.5.1.jar" to "C:\Program Files\SmartBear\ReadyAPI-3.47.0\bin\ext", but grab command will not work: Wed Jul 05 11:37:12 CEST 2023: ERROR: An error occurred in the script of the Groovy Script test step [Groovy Script]: Wed Jul 05 11:37:12 CEST 2023: ERROR: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script13.groovy: 1: Unexpected input: '@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.3')' @ line 1, column 81. oovy-wslite', version='1.1.3') Thank you in advance! sp00ky10 months agoPlace ReadyAPI QuestionsReadyAPI Questions569Views0likes0Comments