Show / Hide Table of Contents

Class IdentityAuthProvider<TModel, TUser>

Auth provider that uses ASP.NET Core Identity to authorize the user

Inheritance
Object
IdentityAuthProvider<TModel, TUser>
Implements
IAuthProvider<TModel, TUser>
Namespace: Seltzr.Auth
Assembly: Seltzr.dll
Syntax
C#
public class IdentityAuthProvider<TModel, TUser> : IAuthProvider<TModel, TUser> where TModel : class where TUser : class
Type Parameters
TModel

The type of model that this API handles

TUser

The type of the authenticated user context

Constructors

| Improve this Doc View Source

IdentityAuthProvider()

Initializes a new instance of the IdentityAuthProvider<TModel, TUser> class.

C#
public IdentityAuthProvider()
| Improve this Doc View Source

IdentityAuthProvider(IEnumerable<String>)

Initializes a new instance of the IdentityAuthProvider<TModel, TUser> class.

C#
public IdentityAuthProvider(IEnumerable<string> roles)
Parameters
rolesIEnumerable<String>

The roles that the must be in to authenticate

| Improve this Doc View Source

IdentityAuthProvider(String)

Initializes a new instance of the IdentityAuthProvider<TModel, TUser> class.

C#
public IdentityAuthProvider(string policy)
Parameters
policyString

The policy that the must fulfill to authenticate

| Improve this Doc View Source

IdentityAuthProvider(String, IEnumerable<String>)

Initializes a new instance of the IdentityAuthProvider<TModel, TUser> class.

C#
public IdentityAuthProvider(string policy, IEnumerable<string> roles)
Parameters
policyString

The policy that the must fulfill to authenticate

rolesIEnumerable<String>

The roles that the must be in to authenticate

Methods

| Improve this Doc View Source

AuthenticateAsync(IApiContext<TModel, TUser>)

Authenticates the given request context, and returns the authenticated user

C#
public virtual 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#
public virtual Task<bool> CanAuthAsync(IApiContext<TModel, TUser> context)
Parameters
contextIApiContext<TModel, TUser>

The current API context

Returns

Task<Boolean>

true always

Implements

IAuthProvider<TModel, TUser>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX