# SSO Callback closes connection (0 bytes sent by server); used logged out of impersonation previously

**URL:** https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064
**Category:** SSO
**Created:** [June 5, 2022, 2:43pm UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064 "2022-06-05T14:43:45Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![simon.michalke](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@simon.michalke](https://meta.discourse.org/u/simon.michalke)
#### Post date: [June 5, 2022, 2:43pm UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/1 "2022-06-05T14:43:45Z")

</div>

(Note, this was also reported here: [Connection lost during callback · Issue #28 · habi-dat/discoursesso · GitHub](https://github.com/soudis/discoursesso/issues/28))

Hello,

we are having a _very weird_ issue with our [Discourse SSO](https://meta.discourse.org/t/13045?silent=true). Ever since one user logged out of impersonation, he is unable to log back in. This is what happens now if he tries to log in: (the user was logged into Nextcloud previously).

 ![grafik](https://global.discourse-cdn.com/meta/original/4X/1/3/7/13788a6839d2f407a3e9477f7580a8b23a771cbd.png)

The Server just closes the connection. I am unable to find any error log. Not inside any of the nginx proxies, not inside Discourse, not inside Nextcloud.

Interestingly it has nothing to do with the network or device. It is just this user that fails to log in.

I also tried clearing out the SSO Data from Discourse, changed the Email Address to force creation of a new Discourse Account. The Problem still persists.

I suspect this is an issue with the Nextcloud plugin, however I don’t see any error messages by Discourse, which surprises me. (I cleared the log and tried again, no record appeared.)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [June 5, 2022, 3:00pm UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/2 "2022-06-05T15:00:05Z")

</div>

Did you enable Admin - Settings - Login - `verbose_discourse_connect_logging` ?

---

<div class="post-metadata">

### Author: ![simon.michalke](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@simon.michalke](https://meta.discourse.org/u/simon.michalke)
#### Post date: [June 5, 2022, 3:25pm UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/3 "2022-06-05T15:25:11Z")

</div>

I just did. The only record is:

```plaintext
Verbose SSO log: Started SSO process

add_groups: 
admin: 
moderator: 
avatar_force_update: 
avatar_url: 
bio: 
card_background_url: 
confirmed_2fa: 
email: 
external_id: 
groups: 
locale: 
locale_force_update: 
location: 
logout: 
name: 
no_2fa_methods: 
nonce: <removed>
profile_background_url: 
remove_groups: 
require_2fa: 
require_activation: 
return_sso_url: https://hub.diehumanisten.de/session/sso_login
suppress_welcome_message: 
title: 
username: 
website: 

```

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 20, 2022, 12:08pm UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/4 "2022-06-20T12:08:25Z")

</div>

Is this issue still ongoing @simon.michalke?

---

<div class="post-metadata">

### Author: ![simon.michalke](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@simon.michalke](https://meta.discourse.org/u/simon.michalke)
#### Post date: [June 20, 2022, 12:36pm UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/5 "2022-06-20T12:36:48Z")

</div>

yes, we just tested it again and it still persists.

---

<div class="post-metadata">

### Author: ![simon.michalke](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@simon.michalke](https://meta.discourse.org/u/simon.michalke)
#### Post date: [June 24, 2022, 9:40am UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/6 "2022-06-24T09:40:59Z")

</div>

Okay, now we have a REAL issue. The problem seems to be spreading to other user. And the second one is not an admin and can therefore not use the workaround.

If I want to contact (paid) support, who should I talk to in my case?

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 5, 2022, 10:04am UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/7 "2022-07-05T10:04:51Z")

</div>

Was this the right answer to your issue in the end? 🤞

> [@\[Paid\] Help with fixing SSO issue OR adapting (simplifying) SAML Plugin](https://meta.discourse.org/t/paid-help-with-fixing-sso-issue-or-adapting-simplifying-saml-plugin/231000/2):
>
> I think I found the issue:
> 
> [Yahoo login for Discourse - #13 by pfaffman](https://meta.discourse.org/t/yahoo-login-for-discourse/74060/13)
> 
> closing this for now.

---

<div class="post-metadata">

### Author: ![simon.michalke](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@simon.michalke](https://meta.discourse.org/u/simon.michalke)
#### Post date: [July 5, 2022, 10:27am UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/8 "2022-07-05T10:27:51Z")

</div>

Yes. Nextcloud SSO only supports GET and not POST-based login. Our nginx proxy silently dropped the request since we had too many groups filling up the request header.

Our current workaround is manually patching the Plugin to not include groups:  
[https://github.com/soudis/discoursesso/issues/28#issuecomment-1165819892](https://github.com/soudis/discoursesso/issues/28#issuecomment-1165819892)

We will switch to keycloak for authentication soon.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [October 27, 2022, 9:10pm UTC](https://meta.discourse.org/t/sso-callback-closes-connection-0-bytes-sent-by-server-used-logged-out-of-impersonation-previously/229064/9 "2022-10-27T21:10:00Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
