Skip to content

Commit ae05ebe

Browse files
committed
Add SHO and EPPN to SBS authz call
1 parent 764d0a6 commit ae05ebe

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

library/EngineBlock/Corto/Filter/Command/SRAMInterruptFilter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,17 @@ private function buildRequest(): AuthzRequest
9191
$attributes = $this->getResponseAttributes();
9292
$id = $this->_request->getId();
9393

94-
// $user_id = $attributes['urn:mace:dir:attribute-def:uid'][0];
9594
$user_id = $this->_collabPersonId;
95+
$sho = $attributes['urn:mace:terena.org:attribute-def:schacHomeOrganization'][0] ?? "";
96+
$eppn = $attributes['urn:mace:dir:attribute-def:eduPersonPrincipalName'][0] ?? "";
9697
$continue_url = $this->_server->getUrl('SRAMInterruptService', '') . "?ID=$id";
9798
$service_id = $this->_serviceProvider->entityId;
9899
$issuer_id = $this->_identityProvider->entityId;
99100

100101
return AuthzRequest::create(
101102
$user_id,
103+
$sho,
104+
$eppn,
102105
$continue_url,
103106
$service_id,
104107
$issuer_id

src/OpenConext/EngineBlockBundle/Sbs/Dto/AuthzRequest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ class AuthzRequest implements JsonSerializable
2828
*/
2929
public $userId;
3030

31+
/**
32+
* @var string
33+
*/
34+
public $schacHomeOrganization;
35+
36+
/**
37+
* @var string
38+
*/
39+
public $eduPersonPrincipalName;
40+
3141
/**
3242
* @var string
3343
*/
@@ -45,17 +55,23 @@ class AuthzRequest implements JsonSerializable
4555

4656
public static function create(
4757
string $userId,
58+
string $sho,
59+
string $eppn,
4860
string $continueUrl,
4961
string $serviceId,
5062
string $issuerId
5163
) : AuthzRequest {
5264
Assertion::string($userId, 'The userId must be a string.');
65+
Assertion::string($sho, 'The schacHomeOrganization must be a string.');
66+
Assertion::string($eppn, 'The eduPersonPrincipalName must be a string.');
5367
Assertion::string($continueUrl, 'The continueUrl must be a string.');
5468
Assertion::string($serviceId, 'The serviceId must be a string.');
5569
Assertion::string($issuerId, 'The issuerId must be a string.');
5670

5771
$request = new self();
5872
$request->userId = $userId;
73+
$request->schacHomeOrganization = $sho;
74+
$request->eduPersonPrincipalName = $eppn;
5975
$request->continueUrl = $continueUrl;
6076
$request->serviceId = $serviceId;
6177
$request->issuerId = $issuerId;
@@ -67,6 +83,8 @@ public function jsonSerialize() : array
6783
{
6884
return [
6985
'user_id' => $this->userId,
86+
'sho' => $this->schacHomeOrganization,
87+
'eppn' => $this->eduPersonPrincipalName,
7088
'continue_url' => $this->continueUrl,
7189
'service_id' => $this->serviceId,
7290
'issuer_id' => $this->issuerId

0 commit comments

Comments
 (0)