Hi,
Here is my code snippet,
val auth_token = scenario(“POST Authentication”).exec(
http(“POST OAuth Req”)
.post(“https://keycloak.cp0396.csfp.dyn.nesc.nokia.net/auth/realms/ap-core/protocol/openid-connect/token”)
.formParam(“client_secret”,“7df18c0d-d4c7-47b1-b959-af972684dab0”)
.formParam(“client_id”,“uiv-app”)
.formParam(“grant_type”,“client_credentials”)
.headers(headers_10)
.check(status.is(200)).check(jsonPath("$.access_token").saveAs(“auth_token”))
)
{
println(session(“access_token”).as[String])
session
})
And I am trying to use the value for the Authorization header like below.
val headers_11 = Map(“Content-Type” → “application/json”,“Accept” → “application/json”,“tenantId” → “UIV”,“appId” → “UIV-APP”,"Authorization" → “Bearer $access_token”)
But seeing error,
Failed to build request: No attribute named ‘access_ token’ is defined
Can anybody provide the solution.