Heartbeat monitor api login

I want to monitor API login endpoint /api/v1/login. When I login using postman I get following response

{"id":"###-###-###-###-###","access_token":"****","refresh_token":"****"}

I tried following in heartbeat.yaml reference from here

    - name: api-dev
      tags: ["api"]
      type: http
      enabled: true
      urls: ["http://nginx.dev.svc.cluster.local/api/v1/login"]
      username: 'login.monitor@example.com'
      password: '<password>'
      schedule: '@every 60s'
      check.request:
        method: POST
      check.response:
        status: 200
        json:
          - description: login status
            condition:
              equals:
                status: ok

but got following in kibana UI

Error
received status code 400 expecting [200]
Response Body
Body size is 67B.
{"error":"Bad Authorization header. Expected value 'Bearer <JWT>'"}

What i am missing here ?

Add authorization header as follow

  check.request:
    method: POST
    headers:
      'Authorization': 'Bearer <JWT>'

This need to be access_token OR refresh_token ?

access_token

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.