I'm basically just experimenting with Ory at this point, as evaluating some options to deal with SSO. I can't really test the Edge Caching mechanism since it's only available to paid plans, but while testing from Brazil, calling the whoami api takes about 1s every time, which would make the back-end too slow for what we're aiming at. The user experience should be really fast, but it won't be if we have to check against Ory upon every single request. That's why I was curious if there was a way we could use our own gateway session to speed things up and only authenticate the user against Ory once in a while. If I understood correctly from the docs, with Edge caching it would be possible to specify some low expiry time to improve things up, but we could probably do that too in our own gateway, which should improve the user experience if we only had to query Ory once per minute, for example, but I'd prefer a better way so that users wouldn't have to wait for at least 1s once a minute.
I was thinking about building a gateway that would be responsible for every action related to authentication (logout, session invalidation and so on). As long as the gateway is always used for dealing with authentication related actions, it should be fine. I mean, we would enforce a policy that each application would be forbidden to expose the js-client api to authentication-related actions such as logout or session invalidation. This way we'll always know when a user's session should be invalidated for all backends.
Am I missing something?