HubAuthService
in package
implements
HubAuthServiceInterface
Class HubAuthService
Tags
Interfaces, Classes and Traits
- HubAuthServiceInterface
- Interface HubSessionKeyServiceInterface
Table of Contents
- $hubAuthStorage : HubAuthStorage
- $hubClientKeyConfiguration : HubClientKeyConfiguration
- __construct() : mixed
- HubAuthService constructor.
- authByAuthHash() : bool
- Authenticate by hash file in cache directory.
- authByHubClientKey() : bool
- Authenticate by HubClientKey.
Properties
$hubAuthStorage
protected
HubAuthStorage
$hubAuthStorage
$hubClientKeyConfiguration
protected
HubClientKeyConfiguration
$hubClientKeyConfiguration
Methods
__construct()
HubAuthService constructor.
public
__construct(HubAuthStorageInterface $hubAuthStorage, HubClientKeyConfiguration $hubClientKeyConfiguration) : mixed
Parameters
- $hubAuthStorage : HubAuthStorageInterface
-
Used for the filesystem operations.
- $hubClientKeyConfiguration : HubClientKeyConfiguration
-
Used for the database operations.
Return values
mixed —authByAuthHash()
Authenticate by hash file in cache directory.
public
authByAuthHash(AuthHash $authHash) : bool
This method will make sure that file with the provided hash as name, exists in the cache directory. It will remove the file afterwards for security reasons. Make sure that you create the file yourself.
Parameters
- $authHash : AuthHash
-
The hash to be used for the authentication.
Return values
bool —Returns the authentication result.
authByHubClientKey()
Authenticate by HubClientKey.
public
authByHubClientKey(HubClientKey $hubClientKey) : bool
This method will check if the provided HubClientKey is equal to the one that is stored in the database.
Parameters
- $hubClientKey : HubClientKey
-
The key to be used for the authentication.
Return values
bool —Returns the authentication result.