Skip to content

Commit d110052

Browse files
committed
Migrate saml:AuthnContext
1 parent ea70b5d commit d110052

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

modules/saml/src/Controller/ServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,10 @@ public function assertionConsumerService(Request $request, string $sourceId): Re
409409
}
410410

411411
$state['LogoutState'] = $logoutState;
412-
$state['saml:AuthenticatingAuthority'] = $authenticatingAuthority;
412+
$state['saml:AuthenticatingAuthority'] = array_map(
413+
fn($authority): string => $authority->getContent(),
414+
$authenticatingAuthority,
415+
);
413416
$state['saml:AuthenticatingAuthority'][] = $issuer;
414417
$state['PersistentAuthData'][] = 'saml:AuthenticatingAuthority';
415418
$state['saml:AuthnInstant'] = $assertion->getAuthnInstant();

modules/saml/src/IdP/SAML2.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,10 @@ private static function buildAssertion(
12331233
)
12341234
);
12351235

1236-
$sessionStart = time();
1236+
$systemClock = LocalizedClock::in(new DateTimeZone('Z'));
1237+
$now = $systemClock->now();
1238+
1239+
$sessionStart = $now;
12371240
if (isset($state['AuthnInstant'])) {
12381241
$a->setAuthnInstant($state['AuthnInstant']);
12391242
$sessionStart = $state['AuthnInstant'];
@@ -1245,9 +1248,6 @@ private static function buildAssertion(
12451248
$randomUtils = new Utils\Random();
12461249
$a->setSessionIndex($randomUtils->generateID());
12471250

1248-
$systemClock = LocalizedClock::in(new DateTimeZone('Z'));
1249-
$now = $systemClock->now();
1250-
12511251
// ProtcolBinding of SP's <AuthnRequest> overwrites IdP hosted metadata configuration
12521252
$hokAssertion = null;
12531253
if ($state['saml:Binding'] === C::BINDING_HOK_SSO) {

0 commit comments

Comments
 (0)