NAME
Kernel::WebApp::Controller::API::Role::RequiresAgentAuthentication – Require a valid agent token.
PUBLIC INTERFACE
Just consume this role to make sure that your endpoint can only be used by agents with a valid token:
with qw(
Kernel::WebApp::Controller::API::Role::RequiresAgentAuthentication
)
It works by wrapping a default implementation around Kernel::WebApp::Controller::API::Base::Authenticate(), which requires a valid token or otherwise sends a 401 Unauthenticated
response.
You can still provide your own Authenticate()
method to perform additional checks in the endpoint.
See also Kernel::WebApp::Controller::API::Role::AllowsAgentAuthentication.