feat: expose person_id and address_id as separate userinfo claims

This commit is contained in:
Björn Fromme
2026-08-12 17:47:29 +02:00
parent 7ebd2dad1a
commit aa486a4931
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -137,7 +137,8 @@ class PersonalData
public function getClaims(): array public function getClaims(): array
{ {
return [ return [
'id' => $this->personId, 'person_id' => $this->personId,
'address_id' => $this->addressId,
'email' => $this->communication->email, 'email' => $this->communication->email,
'roles' => $this->roles, 'roles' => $this->roles,
'profile' => [ 'profile' => [
+2 -1
View File
@@ -30,7 +30,8 @@ class UserinfoController extends AbstractController
// extend scopes depending on granted permissions // extend scopes depending on granted permissions
if ($this->isGranted('ROLE_OAUTH2_ID')) { if ($this->isGranted('ROLE_OAUTH2_ID')) {
$scopes[] = 'id'; $scopes[] = 'person_id';
$scopes[] = 'address_id';
} }
if ($this->isGranted('ROLE_OAUTH2_PROFILE')) { if ($this->isGranted('ROLE_OAUTH2_PROFILE')) {
$scopes[] = 'profile'; $scopes[] = 'profile';