NAME
Kernel::WebApp::Controller::API::Role::RequiresAgentOrCustomerAuthentication – Require a valid agent|customer token.
PUBLIC INTERFACE
Just consume this role to make sure that your endpoint can be used by agents or customer with a valid token:
with qw(
Kernel::WebApp::Controller::API::Role::RequiresAgentOrCustomerAuthentication
)
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.