NAME
Kernel::WebApp::Controller::API::Role::AllowsAgentAuthentication – Allow the usage of a valid agent token.
PUBLIC INTERFACE
Just consume this role to make sure that your endpoint can be used by agents with or without a valid token:
with qw(
Kernel::WebApp::Controller::API::Role::AllowsAgentAuthentication
)
It works by wrapping a default implementation around Kernel::WebApp::Controller::API::Base::Authenticate(), which requires processes the agent token if present and provides the agent login in the attribute AuthenticatedAgentUserLogin
.
You can still provide your own Authenticate()
method to perform additional checks in the endpoint.
See also Kernel::WebApp::Controller::API::Role::RequiresAgentAuthentication.