Skip to content

Commit

Permalink
Fix pre-filled username
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 1, 2024
1 parent f3bbbc0 commit c96defa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/IdP/ADFS.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public static function receiveAuthnRequest(Request $request, IdP $idp): Streamed

Logger::info('ADFS - IdP.prp: Incoming Authentication request: ' . $issuer . ' id ' . $requestid);

if ($request->query->has('username')) {
$username = (string) $request->query->get('username');
}

$state = [
'Responder' => [ADFS::class, 'sendResponse'],
'SPMetadata' => $spMetadata->toArray(),
Expand All @@ -47,6 +51,10 @@ public static function receiveAuthnRequest(Request $request, IdP $idp): Streamed
'adfs:wreply' => false,
];

if ($username !== null) {
$state['core:username'] = $username;
}

if (isset($query['wreply']) && !empty($query['wreply'])) {
$httpUtils = new Utils\HTTP();
$state['adfs:wreply'] = $httpUtils->checkURLAllowed($query['wreply']);
Expand Down

0 comments on commit c96defa

Please sign in to comment.