Oauth2 bearer
Hi guys,
first of all, I hope to explain the issue in the correct way.
I have 2 calls, one to retreive the jwt, the other one to do forge.
In the second one in Aouth panel in Access token field I have to put the access token from the first call.
If in Access token field I put directly the value, works, but if I try to get from the response it doesn't.
Attachment describe better the scenario
I solved with groovy script.
Below the solution.
import com.eviware.soapui.config.AuthEntryTypeConfig
def authProfileName = "Bearer"
def project = testRunner.getTestCase().getTestSuite().getProject()
def authProfile = project.getAuthRepository().getEntry(authProfileName)
//authProfile.setDomain ("newDomain")
def accessToken = context.expand( '${Verify Token 2 - token - v4 Generazione JWT per Forge token#Response#$[\'accessToken\']}' )
authProfile.setAccessToken(accessToken)
//Set to true for pre-emptive authentication
//Set to false for using global preference
//authProfile.setPreemptive(true)def step = testRunner.testCase.getTestStepByName("Verify Forge - forge token - v4").getHttpRequest()
step.setSelectedAuthProfile(authProfileName)