ory / kratos

The most scalable and customizable identity server on the market. Replace your Homegrown, Auth0, Okta, Firebase with better UX and DX. Has all the tablestakes: Passkeys, Social Sign In, Multi-Factor Auth, SMS, SAML, TOTP, and more. Written in Go, cloud native, headless, API-first. Available as a service on Ory Network and for self-hosters.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=kratos
Apache License 2.0
11.32k stars 963 forks source link

Search engine #2783

Closed david972 closed 1 year ago

david972 commented 2 years ago

Preflight checklist

Context and scope

The goal is to design the search engine feature to retrieve and filtering the results

Goals and non-goals

Goals

The design

TO DO

APIs

No response

Data storage

No response

Code and pseudo-code

No response

Degree of constraint

No response

Alternatives considered

https://github.com/ory/kratos/pull/2442#issuecomment-1190867502

david972 commented 2 years ago

@ofairfoul https://github.com/ory/kratos/pull/2442#issuecomment-1190867502 Would it be possible to simply expose FindByCredentialsIdentifier on the Admin Identity API? I think this would meet the needs of the majority of people who just want to find usernames(emails) which are already registered. e.g. https://developer.okta.com/docs/reference/api/users/#get-user-with-login

kmherrmann commented 2 years ago

Yes, I believe that makes sense!

Windfarer commented 2 years ago

It would be better if we can query by the fields from public_metadata and admin_metadata

aeneasr commented 2 years ago

@ofairfoul #2442 (comment) Would it be possible to simply expose FindByCredentialsIdentifier on the Admin Identity API? I think this would meet the needs of the majority of people who just want to find usernames(emails) which are already registered. e.g. https://developer.okta.com/docs/reference/api/users/#get-user-with-login

That's a good idea IMO! @zepatrik probably also needs this!

david972 commented 2 years ago

let me know I can spend time on it

kmherrmann commented 2 years ago

@david972 a PR would be much appreciated! :)

viters commented 1 year ago

@david972 @kmherrmann Hows it going? Seems like a really nice feature to have with not a lot of work required to deliver, I could try to pick it up if it got stuck. I see only one closed PR https://github.com/ory/kratos/pull/2442 related to this, with different approach to implementation.

david972 commented 1 year ago

Very well and you ? The other one was to "translate" the call into sql query this one is to expose a method on admin side

jonas-jonas commented 1 year ago

FYI, we now shipped the credentials_identifier query parameter in the listIdentities endpoint:

artsiommiksiuk commented 2 months ago

@jonas-jonas, by any chance, idk if you aware, but what about "preview_credentials_identifier_similar" field in listIdentities? It states that it will be removed, but some fuzzy search functionality is also needed for my use cases. I can't find any info about this field.

Also, I don't see any resolution nor discussion about lookup in metadata fields as well. Every ticket and discussion leading here, and it was just closed with only exact match filtering. Exact match lookup is barely can be called a search engine functionality IMHO.

Would be nice to understand if there's any plan, or discussion which I just overlooked about identities search .

jonas-jonas commented 2 months ago

The problem with that parameter is, that the underlying database needs to support it well, which hasn't always been the case, yielding inconsistent results and database issues.

Adding support for search engines is a huge topic, that is not on our immediate roadmap, unfortunately. That includes metadata lookup, which is similarly complex, because of the schema-less nature of metadata.

artsiommiksiuk commented 2 months ago

That's a bummer. So, if we need it, the only option for us is to implement own GDPR compliant (because we are in EU) index for that?

jonas-jonas commented 2 months ago

preview_credentials_identifier_similar is based on such an index, so for now it will keep working.

aeneasr commented 2 months ago

We removed it, it’s not scalable