Hi, I'm looking for info as I have to choose betwe...
# support-questions-legacy
e
Hi, I'm looking for info as I have to choose between cookie based/jwt login. But I cannot find right documentation. I have a multitenant, microservice ecosystem, with multiple (web) frontend apps and multiple apis. Once I login in a single frontend app, I must be authenticated in all frontend apps. I have a dedicated supertokens backend microservice (with core hosted internally) where I actually do authentication. No user is shared between different tenant. I cannot use (and I do not want to do it) supertokens SDK in all my backend microservices exposing api (they are a lot, in many different languages). What's the correct choice?
r
Hey @edubacco
Are all the frontends different sub domains of the same base domain? And what about all the backends?
e
everything shares the same base domain
(hi rp, how are you? 😄 )
r
Im good. Thanks! How r u?
Right. And once a user logs in, they should be logged in everywhere, right?
e
exactly, per single tenant (we have no shared users in different tenants)
r
I’m not sure why you mean by per single tenant here
e
so if a user wants to login to another tenant, it has to register to that tenant before, and it has to do two logins
r
And each tenant has its own frontend sub domain?
e
because tenant = customer, and I cannot say to one of my customer "hey, you will inherit users from a different customer"
each tenant has its own frontend subdomain yes, but the base domain can or cannot be the same of the other tenant
r
Right. So a user logs into a sub domain, and they should remain logged into that sub domain, and only that sub domain?
And essentially you only want to share a session across multiple backend domains, right?
e
it should remain logged into every sub domain of the tenant (we have multiple frontend apps)
r
So a tenant can have specific sub domains, whilst another tenant can have other specific sub domains?
e
exactly
r
Okay.
And what about backend domains? Is that also specific to each tenant? Or shared across all tenants?
e
ah yes, that's the point. They are shared
e
I can have dedicate domains (one per tenant) for ST backend if needed
r
Not needed
The above links will have a setup that u want
However the only restriction is that a user cannot login to multiple tenants at the same time.
e
not a big problem at the moment
the last link says "paid feature". It refers to multitenancy, or having custom domain for multitenancy is a different fee from multitenancy itself?
r
No no
e
ok
another question: my first concern was, should I use cookies or tokens?
r
Cookies should be fine
As long as the base domain of frontend is the same as the backend
If u have a case where that’s not that case, you should use header based tokens instead
e
and using cookies, how my backend api authenticate the user?
r
Just regular JWT verification
U can read from sAccessToken cookie
And use any JWT lib for that language
e
yep, got it
thanks
5 Views