p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
406 stars 72 forks source link

adding count organizations endpoint #73

Closed paulwer closed 1 year ago

paulwer commented 1 year ago

Hey everyone, we're integrating p2-orgs within our system and wanted to have a standard way to get the whole count of available orgs. are we missing something or is this a possible pr?

xgp commented 1 year ago

Hi @paulwer thanks for the suggestion. There is no method to get the count of orgs. Right now, you'd have to use this https://phasetwo.io/api/get-organizations and paginate through them all in order to count them. I think a count method would be a great addition, in a similar format to how keycloak does groups counts. E.g. something like /realms/{realm}/orgs/count that takes an optional search query string. PR most welcome for this.

xgp commented 1 year ago

added /realms/{realm}/orgs/count endpoint in #79

paulwer commented 1 year ago

@xgp is there a need to add this also to keycloak-js js library?

xgp commented 1 year ago

@paulwer I'm assuming you mean the sdk client libs. Yes, the sdk libs need to get updated with the changes.