We are storing some user defined parameters in the AuthUserSession.Meta, it is working create when we make our api calls using cookies and passing the ss-id cookie.
Then there was a situation where we were authentication using “Authorization: Bearer” in the header, everything works fine, it authenticates etc. but it doesn’t populate the AuthUserSession.Meta.
Is this by behavior, bug or I need some additional configurations?
So I am already pushing properties such as tenant_id and customer_id using the CreatePayloadFilter which works great.
So my end goal is not to have to Query the DB for each authenticated api call to get the tenant_id and customer_id using the UserAuthId. Since I already have tenant_id and customer_id pushed into the Payload how do I read those two properties on api calls after being authenticated (the goal is to avoid reading the DB each time).
Please see my existing links, what you add to the JWT Payload with CreatePayloadFilter you can use to populate the User Session using PopulateSessionFilter.
Whatever Custom User Session you’ve registered in your AuthFeature constructor, i.e:
Plugins.Add(new AuthFeature(() => new CustomUserSession) { ... });