View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006128 | SOGo | Backend General | public | 2025-06-10 10:15 | 2025-06-23 07:21 |
Reporter | markus.grandpre | Assigned To | qhivert | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | [Server] Linux | OS | Debian | OS Version | 8 (Jessie) |
Product Version | 5.12.1 | ||||
Fixed in Version | 5.12.2 | ||||
Summary | 0006128: AuthNZ attempt via xoauth2 results in violating not-null constraint | ||||
Description | When trying to have SOGo authenticate and authorize a user using
"sogo_openid" violates not-null constraint However, when I look at the token I received from the identity provider,
"expires_in" = 600; "id_token" = "..."; scope = "openid profile email"; You’ll find the full stack trace of the error below. Why is SOGo unable Best regards | ||||
Steps To Reproduce |
systemctl stop sogo/usr/sbin/sogo-tool expire-sessions 0
{ | ||||
Additional Information | 2025-06-10 10:16:14.988 sogod[243522:243522] fetch token response: | ||||
Tags | oidc, postgresql, xoauth2 | ||||
Hello,
|
|
openid server is s Shibboleth IDP v5.1.4 with Plugin: net.shibboleth.oidc.common Current Version: 3.2.0 |
|
Now I have gdb installed on our test system. Please guide me to set breakpoints at the appropriate locations. |
|
Do you use the release 5.12.1 or the nightly after 5.12.1 ? |
|
It's the latest nightly: sogo v5.12.1.20250610-1 |
|
Ok, put a breakpoint here -> https://github.com/Alinto/sogo/blob/9954c3607bfda55424f5ac532a1075407235f345/SoObjects/SOGo/SOGoOpenIdSession.m#L5637
It is after sogo fetch the token. When here, check the value of the var expiresIn
You can also check the dictionary from the request response
Then put a breakpoint here -> https://github.com/Alinto/sogo/blob/9954c3607bfda55424f5ac532a1075407235f345/SOPE/GDLContentStore/GCSOpenIdFolder.m#L310
It is just before inserting in the database, check the value of expiration and the dictionary of columns/value |
|
|
|
Ah sorry I haven't explained it properly. First launch gdb with sogo with the correct IP and port (the value you put for WOPort in your sogo.conf or init.d/sogo.service)
If sogo directly runs, you may stop it first with ctrl-c Then set your two breakpoints:
If gdb ask for missing library, say yes/y. Then run sogo, again say yes if gdb ask something
Then go to your browser and go to SOGo and do all the process to connect yourself. When you successfully login to your openid server, the breakpoints should stop the program. Then here you can check the variables with p and po. |
|
Breakpoint 1:
Breakpoint 2: |
|
Beware the last one is
All I can see seems all right, the value 600 is correctly fetch and nowExpire is timsestamp + 600. newRecord is the value used for the sql query. |
|
|
|
Ok i've found the culprit and made a fix. First remove sogo and change the repo url (assuming your test server is also debian jessie) When fixing it I notice you have |
|
Thank you very much.
So I will install the updated package tomorrow and will get back to you with the result.
I guess it would be more appropriate setting this option to NO and adding a SOGoOpenIdScope? Best regards, |
|
Sorry, I meant I didn't push the fix into the main branch so it won't be in the nightly yet. Hence the custom repo so people can test it and check it. If you can change the repo and check it works correctly, it will help me a lot.
The refresh token is not mandatory and purely a openid server config. If you're unsure about it, just set SOGoOpenIdEnableRefreshToken to NO. |
|
we are on Debain 11 (bullseye) |
|
Hi, |
|
After installing sogo and sogo-dbg v5.12.1.20250612-1 i did not encounter any postgresql errors in the log file. Database table "sogo_openid" has been successfully updated. Thank you very much. Best regards, |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2025-06-10 10:15 | markus.grandpre | New Issue | |
2025-06-10 10:15 | markus.grandpre | Tag Attached: oidc | |
2025-06-10 10:15 | markus.grandpre | Tag Attached: postgresql | |
2025-06-10 10:15 | markus.grandpre | Tag Attached: xoauth2 | |
2025-06-10 10:18 | qhivert | Assigned To | => qhivert |
2025-06-10 10:18 | qhivert | Status | new => assigned |
2025-06-10 10:22 | qhivert | Note Added: 0018244 | |
2025-06-10 10:22 | qhivert | Status | assigned => feedback |
2025-06-10 10:28 | markus.grandpre | Note Added: 0018245 | |
2025-06-10 10:28 | markus.grandpre | Status | feedback => assigned |
2025-06-10 11:00 | markus.grandpre | Note Added: 0018246 | |
2025-06-10 11:12 | qhivert | Note Added: 0018247 | |
2025-06-10 11:12 | qhivert | Status | assigned => feedback |
2025-06-10 11:55 | markus.grandpre | Note Added: 0018248 | |
2025-06-10 11:55 | markus.grandpre | Status | feedback => assigned |
2025-06-10 12:41 | qhivert | Note Added: 0018249 | |
2025-06-10 12:41 | qhivert | Status | assigned => feedback |
2025-06-10 13:56 | markus.grandpre | Note Added: 0018250 | |
2025-06-10 13:56 | markus.grandpre | Status | feedback => assigned |
2025-06-10 14:13 | qhivert | Note Added: 0018251 | |
2025-06-10 14:13 | qhivert | Status | assigned => feedback |
2025-06-10 15:05 | markus.grandpre | Note Added: 0018252 | |
2025-06-10 15:05 | markus.grandpre | Status | feedback => assigned |
2025-06-10 15:17 | qhivert | Note Added: 0018253 | |
2025-06-10 15:17 | qhivert | Status | assigned => feedback |
2025-06-11 07:00 | markus.grandpre | Note Added: 0018254 | |
2025-06-11 07:00 | markus.grandpre | Status | feedback => assigned |
2025-06-11 08:31 | qhivert | Note Added: 0018257 | |
2025-06-11 08:31 | qhivert | Status | assigned => feedback |
2025-06-11 08:36 | qhivert | Note Edited: 0018257 | |
2025-06-11 08:37 | markus.grandpre | Note Added: 0018258 | |
2025-06-11 08:37 | markus.grandpre | Status | feedback => assigned |
2025-06-11 08:42 | qhivert | Note Added: 0018259 | |
2025-06-11 08:42 | qhivert | Status | assigned => feedback |
2025-06-12 08:01 | markus.grandpre | Note Added: 0018262 | |
2025-06-12 08:01 | markus.grandpre | Status | feedback => assigned |
2025-06-12 09:05 | qhivert | Note Added: 0018263 | |
2025-06-12 09:05 | qhivert | Status | assigned => feedback |
2025-06-12 12:30 | markus.grandpre | Note Added: 0018266 | |
2025-06-12 12:30 | markus.grandpre | Status | feedback => assigned |
2025-06-23 07:21 | qhivert | Status | assigned => resolved |
2025-06-23 07:21 | qhivert | Resolution | open => fixed |
2025-06-23 07:21 | qhivert | Fixed in Version | => 5.12.2 |