Uses the default BodyParser
, but can be overridden with the ActionBuilder
interface.
Requires an AuthConfig for success and failure behavior for authentication.
Requires the AsyncAuth component for resolving a user and authorizing.
The default implementation of an ActionBuilder
with enforced authentication.
The default implementation of an ActionBuilder
with enforced authentication. It attempts to verify that the user is
logged-in based on the Request
, and allows the action to proceed if they are. The body of the produced Action
accepts a AuthRequest[A, User] => Future[Result]
, which will allow the action to access the user's details,
if needed.
The incoming request from the user.
A function to invoke if the user is authenticated. e.g. The body of a controller method.
If the user is authenticated, then the Result
of the block
function is returned, along with updated cookies
to prolong their session. If the user is not authenticated, then they receive the Result
as configured by the
available AuthConfig.
Uses the default BodyParser
, but can be overridden with the ActionBuilder
interface.
Uses the default BodyParser
, but can be overridden with the ActionBuilder
interface.
Creates an ActionBuilder
with enforced authorization.
Creates an ActionBuilder
with enforced authorization. First, it verifies that the user is authenticated, then it checks
whether or not the user is authorized against the given authority key.
The authority key the user should be authorized against.
An ActionBuilder
whose invoke block will only be executed if the user is authenticated and authorized for
for the given authority key. If the user is not authorized, then they receive the Result
as configured
by the available AuthConfig.
An
ActionBuilder
for endpoints where authentication or authorization is required.This is one of the main components that will be used in an application. To use, you can simply just inject this component into your controller with a specified Env type.
The environment type of your application.