Unable to capture HTTP response URL due to multiple redirects

I am try to capture a access token which I am redirecting to my localhost. There are multiple redirects and access token come from 3rd redirect call and 4th call is failing.
When I try to capture HTTP response header using “headerRegex” and “currentLocation” I am unable to capture it.
Your help is much appreciated.

Below is the piece of code I am using to capture access token

.header(“Content-Type”, “application/x-www-form-urlencoded”)
.check(currentLocation.transform(s => {
val regexr = “”“access_token=([^&]+)”"".r
val locationKey = regexr findFirstIn s

I have to capture access token from below HTTP response URL which is in 3rd redirect.

The error log is below:

CommonAuth: OK