Replies: 2 comments 3 replies
-
I was thinking about having this down the road mostly with the domain based tenants but I like this list of ways to set the tenant. You've obviously given this some thought. Sounds like a great addition happy to help land it. |
Beta Was this translation helpful? Give feedback.
2 replies
-
We can do this by using it as a library
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would be interesting to share a single instance of GraphJin to serve multiple tenants.
Usually you do this by passing a
tenant_id
in different ways:I think the best way to handle it is with a custom attribute in the JWT token, in the same way GraphJin is doing authentication extracting the user_id from the subject claim of the JWT token.
The idea is to add a JWT config variable
tenant_id_attribute
to define the custom attribute for thetenant_id
. If not defined, the tenant is not going to be searched.Also in development mode, in the same way we use "X-USER-ID" header to simulate an authenticated
user_id
of the user you want to test with, we could use "X-TENANT-ID" to simulate thetenant_id
for testing.I'm working on refactoring the JWT provider to use an interface, after that, I would like to work on this tenant_id idea.
Any comments?
Beta Was this translation helpful? Give feedback.
All reactions