Back oauth2.http Download
oauth2.httphttp
### get-data-with-scopes

# Step 3: Use Refresh Token (automatic)
# If the access token expires, Kulala will automatically refresh it
# using the refresh_token (if available) before making this request

GET https://echo.kulala.app/get HTTP/1.1
Accept: application/json
Authorization: Bearer {{ $auth.token("default") }}

> {%
  const token = response.body.headers.authorization;
  const split = token.split(" ");
  const tokenType = split[0];
  const accessToken = split[1];
  const decoded = JSON.parse(atob(accessToken));
  client.log(`${tokenType} decoded value is`, JSON.stringify(decoded, null, 2));
%}

### get-data-with-scopes-from-mock

# Step 3: Use Refresh Token (automatic)
# If the access token expires, Kulala will automatically refresh it
# using the refresh_token (if available) before making this request

GET https://echo.kulala.app/get HTTP/1.1
Accept: application/json
Authorization: Bearer {{ $auth.token("mock") }}