class UserProvisioningService extends LoggingService (View source)

User provisioning service for external authentication providers Supports both OIDC and SAML user provisioning and linking

Constants

AUTH_METHOD_SQL

Aliases kept for callers; {AuthMethod} owns the vocabulary.

AUTH_METHOD_LDAP

AUTH_METHOD_OIDC

AUTH_METHOD_SAML

private LINKABLE_AUTH_METHODS

Methods with an identity link table; LDAP identity is the username itself.

Properties

protected Logger $logger from  LoggingService

Methods

__construct(PDO $connection, ConfigurationManager $configManager, Logger $logger)

No description

void
logDebug(string $message, array $context = [])

No description

void
logInfo(string $message, array $context = [])

No description

void
logWarning(string $message, array $context = [])

No description

void
logError(string $message, array $context = [])

No description

void
syncExistingUser(int $userId, UserInfoInterface $userInfo)

Sync an already-matched user from external auth data. Identity fields, template mapping and group membership are driven by the auth method's config section; nothing is written when the data is unchanged.

int|null
provisionUser(UserInfoInterface $userInfo, string $providerId)

No description

string|null
getDatabaseUsername(int $userId)

Get the database username for a user ID Used to set correct session username when linking existing users

array
cleanupOrphanedAuthLinks()

Clean up orphaned external authentication links This method finds and removes OIDC/SAML links that point to non-existent users

Details

__construct(PDO $connection, ConfigurationManager $configManager, Logger $logger)

No description

Parameters

PDO $connection
ConfigurationManager $configManager
Logger $logger

protected void logDebug(string $message, array $context = [])

No description

Parameters

string $message
array $context

Return Value

void

protected void logInfo(string $message, array $context = [])

No description

Parameters

string $message
array $context

Return Value

void

protected void logWarning(string $message, array $context = [])

No description

Parameters

string $message
array $context

Return Value

void

protected void logError(string $message, array $context = [])

No description

Parameters

string $message
array $context

Return Value

void

void syncExistingUser(int $userId, UserInfoInterface $userInfo)

Sync an already-matched user from external auth data. Identity fields, template mapping and group membership are driven by the auth method's config section; nothing is written when the data is unchanged.

Parameters

int $userId
UserInfoInterface $userInfo

Return Value

void

int|null provisionUser(UserInfoInterface $userInfo, string $providerId)

No description

Parameters

UserInfoInterface $userInfo
string $providerId

Return Value

int|null

string|null getDatabaseUsername(int $userId)

Get the database username for a user ID Used to set correct session username when linking existing users

Parameters

int $userId

Return Value

string|null

Clean up orphaned external authentication links This method finds and removes OIDC/SAML links that point to non-existent users

Return Value

array

Array with counts of cleaned up links