You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Session has expired. Client must attach with new token #154
I have 3 brokers using the demo sample code. Two of this brokers run on local virtual hosts. The third runs on an online server with HTTPS, as the sso server.
The local brokers works properly (info, login, logout). The online broker return the error "Invalid or expired bearer token". I get the same error even if I run the third broker from the same webserver (with a different context) where the sso server runs.
Once set a different folder to store cache (rather /tmp), a different error occurs: Session has expired. Client must attach with new token.
This error occurs only with a broker while other two brokers works properly. In all cases, the cache files are created, named as SSO-(brokerId)-(token).php.cache and all have the same content. It seems that is not able to resume the session
Hello @jasny, I added some log to the code in order to track the issue. When remote broker (https://www.alessandrolarocca.it/sso-broker, Julius) connect to the SSO server (https://test.echosistemi.it/sso) the broker is successfully attached to the session. Then startBrokerSession is called, the session id is retrieved properly and the checkum validated. Finally it tries to resume the session but fails ($_SESSION is empty) and throws the exception "Session has expired. Client must attach with new token".
Instead if my local broker (broker1.local, Alice) connects the SSO server, the full process including session resume completes successfully.
Please help, I'm discouraged. I don't know what else to try.
Activity
alexlarocca commentedon Feb 7, 2024
the only difference seems to be the path - local virtual hosts do not have context, while the online broker is on /sso-broker
alexlarocca commentedon Feb 7, 2024
The problem is on Server startBrokerSession() call: Bearer token isn't attached to a client session
$sessionId = $this->cache->get($this->getCacheKey($brokerId, $token));$brokerId and $token are properly set but $sessionId is null
alexlarocca commentedon Feb 8, 2024
Once set a different folder to store cache (rather /tmp), a different error occurs: Session has expired. Client must attach with new token.
This error occurs only with a broker while other two brokers works properly. In all cases, the cache files are created, named as SSO-(brokerId)-(token).php.cache and all have the same content. It seems that is not able to resume the session
=== First broker: success ===
=== Second broker: error ===
=== SSO-SSO-Alice-5m5ortumlvcw0kg4occcwgs0w40wgocs4g4ogo0kog8ko8ogw8.php.cache ===
=== SSO-Julius-szln2zwsoqowkoowo084ok844w0csss84s0gkko4gw440cswg.php.cache ===
[-]Invalid or expired bearer token[/-][+]Session has expired. Client must attach with new token[/+]alexlarocca commentedon Feb 8, 2024
@jasny what is the reason why a broker fails to resume session while others do it properly? The session id provided is the same
jasny commentedon Feb 8, 2024
Where is the server running? If that's locally (on your computer), the online broker won't be able to connect.
alexlarocca commentedon Feb 8, 2024
The SSO server is running on https://test.echosistemi.it/sso while the broker with problem is running on https://www.alessandrolarocca.it/sso-broker.
alexlarocca commentedon Feb 9, 2024
Hello @jasny, I added some log to the code in order to track the issue. When remote broker (https://www.alessandrolarocca.it/sso-broker, Julius) connect to the SSO server (https://test.echosistemi.it/sso) the broker is successfully attached to the session. Then startBrokerSession is called, the session id is retrieved properly and the checkum validated. Finally it tries to resume the session but fails ($_SESSION is empty) and throws the exception "Session has expired. Client must attach with new token".
Instead if my local broker (broker1.local, Alice) connects the SSO server, the full process including session resume completes successfully.
Please help, I'm discouraged. I don't know what else to try.
=== Broker OK (Alice) ===
=== Broker ERROR (Julius) ===
SSO-Alice-5r9ygrpp1asc4scos4080ocko8g0osw8gocsww0oskgw0wskok.php.cache
SSO-Julius-5vyqz6xvprk8okck8c8skocosow000ggo0sw84g08soows4gk8.php.cache