Skip to content

Commit 9e83e04

Browse files
blizzzAndyScherzinger
authored andcommitted
debug(session): log token takeover
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 60d8302 commit 9e83e04

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Controller/SAMLController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
use OneLogin\Saml2\Error;
4949
use OneLogin\Saml2\Settings;
5050
use OneLogin\Saml2\ValidationError;
51+
use function OCP\Log\logger;
5152

5253
class SAMLController extends Controller {
5354
use TXmlHelper;
@@ -227,11 +228,20 @@ public function login(int $idp = 1) {
227228

228229
if ($this->session->get(ClientFlowLoginController::STATE_NAME) !== null) {
229230
$flowData['cf1'] = $this->session->get(ClientFlowLoginController::STATE_NAME);
231+
logger('core')->error('Transporting login flow token', [
232+
'requestToken' => $this->session->get(ClientFlowLoginController::STATE_NAME),
233+
]);
230234
} elseif ($this->session->get(ClientFlowLoginV2Controller::TOKEN_NAME) !== null) {
231235
$flowData['cf2'] = [
232236
'token' => $this->session->get(ClientFlowLoginV2Controller::TOKEN_NAME),
233237
'state' => $this->session->get(ClientFlowLoginV2Controller::STATE_NAME),
234238
];
239+
logger('core')->error('Transporting login flow tokens', [
240+
'sessionToken' => $this->session->get(ClientFlowLoginV2Controller::TOKEN_NAME),
241+
'requestToken' => $this->session->get(ClientFlowLoginV2Controller::STATE_NAME),
242+
]);
243+
} else {
244+
logger('core')->error('No login flow tokens found');
235245
}
236246

237247
// Pack data as JSON so we can properly extract it later

0 commit comments

Comments
 (0)