fix: Avoid to log in again with same account because of SSO cookie#1339
fix: Avoid to log in again with same account because of SSO cookie#1339
Conversation
We log in using an In App Browser that stores an SSO cookie. Unfortunately, we do not have a lot of control for this In App Browser which means that when we log out from the app and log in again, we already reconnectec automatically to the same account because the SSO cookie stills exist. By opening the /logout page of Sign Up app, we ensure that the SSO cookie is cleared. We do the same for Twake Mail.
| throw new Error('Logout should not be called with undefined client') | ||
| } | ||
|
|
||
| const signupUrl = flag('signup.url') as string | undefined |
There was a problem hiding this comment.
I'm not sure we should rely on signup.url. Don't we already have config for that? Since cozy-stack call this logout url when we logout from the stack, can't we reuse that? (EndSessionEndpoint I think)
Can we have access to this config there?
There was a problem hiding this comment.
I will check what else is available.
Another point is here we load an page that is not standardized by OIDC/SSO protocols so we should only use this for sign up I think ?
There was a problem hiding this comment.
@Crash-- is it relevant right now?
as far as all the complexity with multi-account will be in sign-up applicaition, and I hope soon we will have this call to a specific OIDC in stack to end specific OIDC session, maybe we can leave with harcoded logout for now?
anyway, if we don't want our app to be an relying party for OIDC flow, id doesn't need OIDC config. and it doesn't have it right now
There was a problem hiding this comment.
(to test this PR I will need it on int env because I have no oidc setup locally)
There was a problem hiding this comment.
I don't know if it's still relevant or not. I know that today we have a misuse of the 'signup.url' flag, and we rely on it for things we should not.
Here if we are sure that we want to call signup/logout then why not, but what about the future if we have external OIDC Provider for our saas platform?
There was a problem hiding this comment.
That's a part of the problem. We should load this signup/logout page only when this page exists.
@shepilov told me that we may add sign up as proxy before external provider. In this case, his PR is relevant, we should merge it and I should slightly update mine to use his PR.
Otherwise, maybe the best is to do nothing else, rely on signup.url flag here until we fix definitively this issue on backend side.
There was a problem hiding this comment.
I'm pretty sure we'll have a proxy, but not sure if it'll be signup. Maybe directly lemon?
Maybe let's just keep signup right now and we'll find a way to achieve that one day.
There was a problem hiding this comment.
Ok so I keep this PR like this. In the future we will find a better way @shepilov I think you can close yours (or keep it opened if you prefer ?)
We log in using an In App Browser that stores an SSO cookie. Unfortunately, we do not have a lot of control for this In App Browser which means that when we log out from the app and log in again, we already reconnectec automatically to the same account because the SSO cookie stills exist.
By opening the /logout page of Sign Up app, we ensure that the SSO cookie is cleared. We do the same for Twake Mail.