AuthToken
class AuthToken
Class AuthToken
The token-based authentication feature allows you to limit the validity of the asset delivery URL to a specific time frame. An authentication token is added as query parameters to the delivery URL, and is used to validate authentication before delivering the asset.
Properties
AuthTokenConfig | $config |
Methods
Indicates whether according to the current configuration, AuthToken is enabled or not
Sets the configuration.
Generates an authorization token.
Details
__construct(Configuration|string|array|null $configuration = null)
AuthToken constructor.
static AuthToken
fromJson(Configuration|string|array|null $configuration = null)
AuthToken named constructor.
bool
isEnabled()
Indicates whether according to the current configuration, AuthToken is enabled or not
AuthToken
configuration(mixed $configuration)
Sets the configuration.
string
generate(null|string $path = null)
Generates an authorization token.
Options: number start_time - the start time of the token in seconds from epoch. string expiration - the expiration time of the token in seconds from epoch. string duration - the duration of the token (from start_time). string ip - the IP address of the client. string acl - the ACL for the token. string url - the URL to authentication in case of a URL token.
Constants
UNSAFE |
|
AUTH_TOKEN_NAME |
|
TOKEN_SEPARATOR |
|
TOKEN_INNER_SEPARATOR |
|
TOKEN_ACL_SEPARATOR |
|