Skip to content

Commit

Permalink
debug(session): log token takeover
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz authored and AndyScherzinger committed May 9, 2024
1 parent 60d8302 commit 9e83e04
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Controller/SAMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
use OneLogin\Saml2\Error;
use OneLogin\Saml2\Settings;
use OneLogin\Saml2\ValidationError;
use function OCP\Log\logger;

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

if ($this->session->get(ClientFlowLoginController::STATE_NAME) !== null) {
$flowData['cf1'] = $this->session->get(ClientFlowLoginController::STATE_NAME);
logger('core')->error('Transporting login flow token', [
'requestToken' => $this->session->get(ClientFlowLoginController::STATE_NAME),
]);
} elseif ($this->session->get(ClientFlowLoginV2Controller::TOKEN_NAME) !== null) {
$flowData['cf2'] = [
'token' => $this->session->get(ClientFlowLoginV2Controller::TOKEN_NAME),
'state' => $this->session->get(ClientFlowLoginV2Controller::STATE_NAME),
];
logger('core')->error('Transporting login flow tokens', [
'sessionToken' => $this->session->get(ClientFlowLoginV2Controller::TOKEN_NAME),
'requestToken' => $this->session->get(ClientFlowLoginV2Controller::STATE_NAME),
]);
} else {
logger('core')->error('No login flow tokens found');
}

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

0 comments on commit 9e83e04

Please sign in to comment.