Interface IAuthProvider<TModel, TUser>
Providers for a Seltzr API authentication
Namespace: Seltzr.Auth
Assembly: Seltzr.dll
Syntax
C#
public interface IAuthProvider<TModel, TUser>
where TModel : class where TUser : class
Type Parameters
TModel
The type of model served by the API
TUser
The authenticated user context type
Methods
Authenticates the given request context, and returns the authenticated user
C#
Task<TUser> AuthenticateAsync(IApiContext<TModel, TUser> context)
Parameters
context
IApiContext<TModel, TUser>
The current API context
Returns
Task<TUser>
The currently authenticated user context
Gets whether or not the given request can be authenticated for
C#
Task<bool> CanAuthAsync(IApiContext<TModel, TUser> context)
Parameters
context
IApiContext<TModel, TUser>
The current API context
Returns
true if this request contains the necessary attributes to be authenticated by this IAuthProvider<TModel, TUser>, false otherwise.