class UserSyncService

Cross-cutting service for "given an Extranet PID, give me a local User.".

Two flows:

  1. importByExtranetPid() — admin pre-assigns someone from the planner; creates a stub user (object_id NULL) populated from PersonAPI.
  2. upgradeStubOnLogin() — at first OIDC login, adopt the existing stub instead of creating a duplicate. Caller falls back to a fresh create if no stub exists.

Constants

private ALLOWED_PERSON_TYPES

private PERSON_TYPE_TO_ROLE

Methods

__construct(UserRepository $userRepository, RoleRepository $roleRepository, EntityManagerInterface $entityManager, ExtranetApiClientFactory $apiClientFactory, UserProvisioningLock $provisioningLock)

No description

importByExtranetPid(string $extranetPid)

No description

User|null
upgradeStubOnLogin(string $email, string $objectId, Role $oidcRole)

If a user already exists with the given email and objectId, oidcRole are set and the found User is returned.

Details

at line 37
__construct(UserRepository $userRepository, RoleRepository $roleRepository, EntityManagerInterface $entityManager, ExtranetApiClientFactory $apiClientFactory, UserProvisioningLock $provisioningLock)

No description

Parameters

UserRepository $userRepository
RoleRepository $roleRepository
EntityManagerInterface $entityManager
ExtranetApiClientFactory $apiClientFactory
UserProvisioningLock $provisioningLock

at line 46
User importByExtranetPid(string $extranetPid)

No description

Parameters

string $extranetPid

Return Value

User

at line 92
User|null upgradeStubOnLogin(string $email, string $objectId, Role $oidcRole)

If a user already exists with the given email and objectId, oidcRole are set and the found User is returned.

If no user with the given email exists, or the objectId differs from the associated objectId, null is returned.

Parameters

string $email
string $objectId
Role $oidcRole

Return Value

User|null