Show / Hide Table of Contents

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

| Improve this Doc View Source

AuthenticateAsync(IApiContext<TModel, TUser>)

Authenticates the given request context, and returns the authenticated user

C#
Task<TUser> AuthenticateAsync(IApiContext<TModel, TUser> context)
Parameters
contextIApiContext<TModel, TUser>

The current API context

Returns

Task<TUser>

The currently authenticated user context

| Improve this Doc View Source

CanAuthAsync(IApiContext<TModel, TUser>)

Gets whether or not the given request can be authenticated for

C#
Task<bool> CanAuthAsync(IApiContext<TModel, TUser> context)
Parameters
contextIApiContext<TModel, TUser>

The current API context

Returns

Task<Boolean>

true if this request contains the necessary attributes to be authenticated by this IAuthProvider<TModel, TUser>, false otherwise.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX