API Services IAuthenticationService - chsxf/mfx GitHub Wiki
IAuthenticationService Interface
interface IAuthenticationService
Summary
Authentication service interface
Since 2.0
Methods
getCurrentAuthenticatedUser
public abstract function getCurrentAuthenticatedUser(): ?User
Gets the current user reference, if an authenticated user exists
Since 2.0
Returns
User
getIdField
public abstract function getIdField(): string
Retrieves users management identifier field name
Since 2.0
Returns
string
Throws
Exception | Reason |
---|---|
MFXException |
If the provided value is not a string or contains invalid characters (only underscores and alphanumeric characters are accepted) |
getTableName
public abstract function getTableName(): string
Retrieves users management table name
Since 2.0
Returns
string
Throws
Exception | Reason |
---|---|
MFXException |
If the provided value is not a string or contains invalid characters (only underscores and alphanumeric characters are accepted) |
hasAuthenticatedUser
public abstract function hasAuthenticatedUser(): bool
Tells if an authenticated user currently exists
Since 2.0
Returns
bool
invalidate
public abstract function invalidate()
Invalidates user session. Logs out the current authenticated user if existing
Since 2.0
isEnabled
public abstract function isEnabled(): bool
Tells if user management is enabled
Since 2.0
Returns
bool
validateWithFields
public abstract function validateWithFields(array $fields): bool
Validates a user session using database fields
Since 2.0
Parameters
Name | Type | Description |
---|---|---|
$fields |
array |
Key-value pairs for database validation |
Returns
boolean
true if the session has been validated, false either