We are trying to explore tenant fetaure of ehrbase in version 23 for our use case .
As part of this below is the configuration we are using:
EHRbase : security is enable with OAUTH and jwt issuer-uri is set
Keycloak(Auth server) : Set up with two new clients with respective users and roles associated and also claim with “tnt” with specific value.
When we run below aql , which given count of compositions for the given template.
SELECT count(c/uid/value) FROM ehr e CONTAINS COMPOSITION c WHERE c/archetype_details/template_id/value=‘test_tenant.en.v0’
Ideally this should have returned only those compositions whose tenant id matches with the one that is being sent as part of jwt token, instead its returning all values irrespective of the tenant for which this was created.
Below is the API used with OAuth
Please let us know, if we are missing anything as part of configuration or part of API itself.
Also, noticed that, once we add new templates/EHR with new tenants the DB table “tenant” is not getting inserted with new value. Was this intentional or do we need to do something as part of this.
Thanks in advance.