Skip to content

fix: Avoid to log in again with same account because of SSO cookie#1339

Merged
zatteo merged 1 commit intomasterfrom
feat/sso-logout
Jan 29, 2026
Merged

fix: Avoid to log in again with same account because of SSO cookie#1339
zatteo merged 1 commit intomasterfrom
feat/sso-logout

Conversation

@zatteo
Copy link
Copy Markdown
Member

@zatteo zatteo commented Jan 21, 2026

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.

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.
@zatteo zatteo requested a review from Crash-- January 21, 2026 07:57
throw new Error('Logout should not be called with undefined client')
}

const signupUrl = flag('signup.url') as string | undefined
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Crash-- pr for just one logout url in instance settings

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(to test this PR I will need it on int env because I have no oidc setup locally)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member Author

@zatteo zatteo Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?)

@zatteo zatteo merged commit 5c2f915 into master Jan 29, 2026
1 check passed
@zatteo zatteo deleted the feat/sso-logout branch January 29, 2026 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants