ApiKeyAuthenticationMiddleware
class ApiKeyAuthenticationMiddleware (View source)
Authenticates API requests by the X-API-Key header and loads the key's user.
This middleware checks for API key in request headers and authenticates the user if the key is valid
Methods
bool
process(Request $request)
Process the request
int
getAuthenticatedUserId(Request $request)
Get authenticated user ID from API key (stateless)
int|null
getAuthenticatedApiKeyId(Request $request)
Get the api_keys row id for the request's key (stateless), for audit logging.
ApiKeyScope|null
getApiKeyScope(Request $request)
Get the permission scope of the request's API key (stateless)
Details
__construct(ApiKeyService $apiKeyService, ConfigurationInterface $config)
No description
bool
process(Request $request)
Process the request
int
getAuthenticatedUserId(Request $request)
Get authenticated user ID from API key (stateless)
int|null
getAuthenticatedApiKeyId(Request $request)
Get the api_keys row id for the request's key (stateless), for audit logging.
ApiKeyScope|null
getApiKeyScope(Request $request)
Get the permission scope of the request's API key (stateless)