Skip to content

NFC-102 Web eID for mobile support#46

Open
SanderKondratjevNortal wants to merge 1 commit intoweb-eid-mobilefrom
NFC-102
Open

NFC-102 Web eID for mobile support#46
SanderKondratjevNortal wants to merge 1 commit intoweb-eid-mobilefrom
NFC-102

Conversation

@SanderKondratjevNortal
Copy link

Signed-off-by: Sander Kondratjev sander.kondratjev@nortal.com

@SanderKondratjevNortal SanderKondratjevNortal force-pushed the NFC-102 branch 2 times, most recently from f18bf64 to 1f0dbe0 Compare January 22, 2026 15:14
…ort for web-eid example

Signed-off-by: Sander Kondratjev <sander.kondratjev@nortal.com>
@SanderKondratjevNortal SanderKondratjevNortal changed the base branch from main to web-eid-mobile January 26, 2026 09:10
$base64ChallengeNonce
);

session_regenerate_id();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session is regenerated twice, see Auth.validate() line 80.

session_regenerate_id();

$subjectName = $this->getPrincipalNameFromCertificate($cert);
$_SESSION["auth-user"] = $subjectName;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to move all session-related logic either up into Auth.validate() (along with session regeneration) or here for consistency.

Comment on lines +50 to +54
if (str_starts_with($baseUrl, 'http')) {
$authUri = rtrim($baseUrl, '/') . '/auth#' . $encodedPayload;
} else {
$authUri = rtrim($baseUrl, '/') . '//auth#' . $encodedPayload;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe ternary conditional would be more clear:

Suggested change
if (str_starts_with($baseUrl, 'http')) {
$authUri = rtrim($baseUrl, '/') . '/auth#' . $encodedPayload;
} else {
$authUri = rtrim($baseUrl, '/') . '//auth#' . $encodedPayload;
}
$fragment = (str_starts_with($baseUrl, 'http') ? '//' : '/') . 'auth#';
$authUri = rtrim($baseUrl, '/') . $fragment . $encodedPayload;


public function assertCsrf(bool $jsonError = true): void
{
$headers = array_change_key_case(getallheaders());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicit is better than implicit:

Suggested change
$headers = array_change_key_case(getallheaders());
$headers = array_change_key_case(getallheaders(), CASE_LOWER);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments