Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetSessionsByID not working properly with active=true query parameter #2930

Closed
6 tasks done
vsumit89 opened this issue Dec 6, 2022 · 1 comment
Closed
6 tasks done
Assignees
Labels
bug Something is not working.

Comments

@vsumit89
Copy link

vsumit89 commented Dec 6, 2022

Preflight checklist

Describe the bug

while getting the active sessions of a user by sending request to kratos admin endpoint - /admin/identities/{identity_id}/sessions?active=true, I am correctly getting all the active sessions but along with it I am getting one inactive (active=false) session.

Reproducing the bug

After running kratos hit the admin endpoint - /admin/identities/{identity_id}/sessions?active=true

Relevant log output

[
  {
    "id": "6fb620fa-4e03-484a-aa40-779ee883ef22",
    "active": false,
    "expires_at": "2022-11-30T12:52:05.179595Z",
    "authenticated_at": "2022-11-29T12:52:05.179595Z",
    "authenticator_assurance_level": "aal1",
    "authentication_methods": [
      {
        "method": "password",
        "aal": "aal1",
        "completed_at": "2022-11-29T12:52:05.17959476Z"
      }
    ],
    "issued_at": "2022-11-29T12:52:05.179595Z",
    "identity": {
      "id": "049e524f-d460-4325-904a-cadd16037a95",
      "schema_id": "default",
      "schema_url": "http://127.0.0.1:4455/.ory/kratos/public/schemas/ZGVmYXVsdA",
      "state": "active",
      "state_changed_at": "2022-11-29T12:27:12.389522Z",
      "traits": {
        "email": "kavach-develop@factly.in"
      },
      "verifiable_addresses": [
        {
          "id": "11ea6fbf-a9ed-4526-a7c4-4351b1a26fb5",
          "value": "kavach-develop@factly.in",
          "verified": true,
          "via": "email",
          "status": "completed",
          "verified_at": "2022-12-05T09:02:07.247184Z",
          "created_at": "2022-11-29T12:27:12.937622Z",
          "updated_at": "2022-11-29T12:27:12.937622Z"
        }
      ],
      "recovery_addresses": [
        {
          "id": "9d676744-7f26-4920-8931-320da67af478",
          "value": "kavach-develop@factly.in",
          "via": "email",
          "created_at": "2022-11-29T12:27:12.977467Z",
          "updated_at": "2022-11-29T12:27:12.977467Z"
        }
      ],
      "metadata_public": null,
      "created_at": "2022-11-29T12:27:12.91245Z",
      "updated_at": "2022-11-29T12:27:12.91245Z"
    },
    "devices": [
      {
        "id": "4762b1e0-5466-4384-ae10-75159972d43a",
        "ip_address": "",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
        "location": ""
      }
    ]
  },
  {
    "id": "f27134a5-7c65-4a42-98c9-709ab22951bf",
    "active": true,
    "expires_at": "2022-12-07T06:49:21.040235Z",
    "authenticated_at": "2022-12-06T06:49:21.040235Z",
    "authenticator_assurance_level": "aal1",
    "authentication_methods": [
      {
        "method": "password",
        "aal": "aal1",
        "completed_at": "2022-12-06T06:49:21.040219625Z"
      }
    ],
    "issued_at": "2022-12-06T06:49:21.040235Z",
    "identity": {
      "id": "049e524f-d460-4325-904a-cadd16037a95",
      "schema_id": "default",
      "schema_url": "http://127.0.0.1:4455/.ory/kratos/public/schemas/ZGVmYXVsdA",
      "state": "active",
      "state_changed_at": "2022-11-29T12:27:12.389522Z",
      "traits": {
        "email": "kavach-develop@factly.in"
      },
      "verifiable_addresses": [
        {
          "id": "11ea6fbf-a9ed-4526-a7c4-4351b1a26fb5",
          "value": "kavach-develop@factly.in",
          "verified": true,
          "via": "email",
          "status": "completed",
          "verified_at": "2022-12-05T09:02:07.247184Z",
          "created_at": "2022-11-29T12:27:12.937622Z",
          "updated_at": "2022-11-29T12:27:12.937622Z"
        }
      ],
      "recovery_addresses": [
        {
          "id": "9d676744-7f26-4920-8931-320da67af478",
          "value": "kavach-develop@factly.in",
          "via": "email",
          "created_at": "2022-11-29T12:27:12.977467Z",
          "updated_at": "2022-11-29T12:27:12.977467Z"
        }
      ],
      "metadata_public": null,
      "created_at": "2022-11-29T12:27:12.91245Z",
      "updated_at": "2022-11-29T12:27:12.91245Z"
    },
    "devices": [
      {
        "id": "0e7415b9-1b8a-403c-8725-f1f3608f2419",
        "ip_address": "",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
        "location": ""
      }
    ]
  },
  {
    "id": "8b3b5d53-9580-4fe0-96c8-c246f45d2396",
    "active": true,
    "expires_at": "2022-12-07T06:54:53.285534Z",
    "authenticated_at": "2022-12-06T06:54:53.285534Z",
    "authenticator_assurance_level": "aal1",
    "authentication_methods": [
      {
        "method": "password",
        "aal": "aal1",
        "completed_at": "2022-12-06T06:54:53.285528335Z"
      }
    ],
    "issued_at": "2022-12-06T06:54:53.285534Z",
    "identity": {
      "id": "049e524f-d460-4325-904a-cadd16037a95",
      "schema_id": "default",
      "schema_url": "http://127.0.0.1:4455/.ory/kratos/public/schemas/ZGVmYXVsdA",
      "state": "active",
      "state_changed_at": "2022-11-29T12:27:12.389522Z",
      "traits": {
        "email": "kavach-develop@factly.in"
      },
      "verifiable_addresses": [
        {
          "id": "11ea6fbf-a9ed-4526-a7c4-4351b1a26fb5",
          "value": "kavach-develop@factly.in",
          "verified": true,
          "via": "email",
          "status": "completed",
          "verified_at": "2022-12-05T09:02:07.247184Z",
          "created_at": "2022-11-29T12:27:12.937622Z",
          "updated_at": "2022-11-29T12:27:12.937622Z"
        }
      ],
      "recovery_addresses": [
        {
          "id": "9d676744-7f26-4920-8931-320da67af478",
          "value": "kavach-develop@factly.in",
          "via": "email",
          "created_at": "2022-11-29T12:27:12.977467Z",
          "updated_at": "2022-11-29T12:27:12.977467Z"
        }
      ],
      "metadata_public": null,
      "created_at": "2022-11-29T12:27:12.91245Z",
      "updated_at": "2022-11-29T12:27:12.91245Z"
    },
    "devices": [
      {
        "id": "caa98cdf-2bef-4c09-a7d6-166033101a39",
        "ip_address": "",
        "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:108.0) Gecko/20100101 Firefox/108.0",
        "location": ""
      }
    ]
  }
]

Relevant configuration

No response

Version

v0.11.0

On which operating system are you observing this issue?

macOS

In which environment are you deploying?

Docker Compose

Additional Context

No response

@vsumit89 vsumit89 added the bug Something is not working. label Dec 6, 2022
@kelkarajay
Copy link
Contributor

kelkarajay commented Dec 14, 2022

In which environment are you deploying?

Docker Compose

This doesn't seem to be correct. No re-pro on self hosted kratos or on Ory Network stack on local-run or staging

peturgeorgievv pushed a commit to senteca/kratos-fork that referenced this issue Jun 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working.
Projects
None yet
Development

No branches or pull requests

2 participants