libero / publisher-micro-frontend-experiment

https://github.com/libero/publisher/issues/371
MIT License
0 stars 0 forks source link

Sessions #5

Closed thewilkybarkid closed 4 years ago

thewilkybarkid commented 4 years ago

Need a mechanism to share sessions between different services.

These [component-level frontends] might also need to know who's logged in (e.g. header having the log in/out links).

thewilkybarkid commented 4 years ago

Couple of different paths for this:

giorgiosironi commented 4 years ago

On one hand if we go API-first it means the underlying APIs have to know if you are logged in, not just the frontends (all public/private caching caveats apply).

Lest we create a single point of failure that all dependencies converge to, this looks more like a token or other signed information that travels in API calls, rather than a shared session in the usual web application sense (which is identical to a shared database).

thewilkybarkid commented 4 years ago

On one hand if we go API-first it means the underlying APIs have to know if you are logged in, not just the frontends (all public/private caching caveats apply).

This matches what we'd spoken about before, so communication between services will be done by a service on behalf of a user (rather than independently, as in eLife's current usage).

thewilkybarkid commented 4 years ago

Think about what needs to be shared between frontend services, it should be just knowing who is logged in. Anything else needs to go through the regular channels (APIs or in-browser events).

Individual services will still have their own session data (eg flash message after filling out a form).

thewilkybarkid commented 4 years ago

There's definitely detail to flesh out, but good to close?

giorgiosironi commented 4 years ago

Yes, the individual services session can be left to their own implementation for example.