```package main import ( "context" "fmt" ...
# talk-kratos
b
Copy code
package main

import (
    "context"
    "fmt"

    client "<http://github.com/ory/client-go|github.com/ory/client-go>"
)

func main() {
    configuration := client.NewConfiguration()
    configuration.Servers = []client.ServerConfiguration{
        {
            URL: "<http://127.0.0.1:4434>", // Kratos Admin API
        },
    }
    apiClient := client.NewAPIClient(configuration)
    checkIdentity := apiClient.V0alpha2Api.AdminListIdentities(context.Background())
    list, _, err := checkIdentity.Execute()
    if err != nil {
        fmt.Println(err)
    }

    fmt.Println("First identity %s", list[0].Id)

}
r
I don't know what you are asking exactly. If you are looking for a way to query and provide parameters to search, I think that is not supported: https://www.ory.sh/docs/kratos/reference/api#tag/v0alpha2/operation/adminListIdentities
b
I want to get the ID of a subject.
I know the subject, with that data how to get the ID
When you use adminlistidentities endpoint it will give you a full list. But I want to get a particular data.
The use case will be like to search for a subjects uiid and remove his Authorization from keto. Because am using uiid as subject in keto.
r
I think right now you have to page through the result and then filter each entity
Or you propose a PR, I think what you are trying to do is filter based on traits. So that sounds good
b
Exactly
Yes right now am getting all details in the state and filter through the array to find the trait detail
f
We have a discussion on adding a „get by credentials identifier”. Would that help?
What key would you retrieve on?
r
Maybe username and email. But it’s hard since the traits are “flexible”
I mean, haven’t looked at the storage but it’s certainly possible. At least I remember from postgres that you can query on json or.. forgot hstor?