namespace Connected.Security.Authentication.Middleware;
///
/// Represents an authentication middleware which is called when authenticating identity.
///
///
/// The environment should have only one registered which
/// uniquely authenticates all requests. The environment have a built in authentication middleware
/// which authenticates identities against standard entities. If you need to authenticate identities
/// against external data sources you need to implement your own and
/// register it in the configuration.
///
public interface IAuthenticationMiddleware : IMiddleware
{
///
/// Performs authentication against identity. Identity is not necessarry a user, it can be device, process
/// or any other entity which needs protection.
///
/// The authentication arguments explaining the identity. The following identities are supported by a
/// default authentication middleware:
///
///
///
///
///
///
///
///
/// containing information about authentication wether it is successfull or not and
/// the reason why it was not successfully. If it's successfully it also provides identity.
///
Task Authenticate(AuthenticationArgs args);
}