Class DbAuthenticationProvider
Database based (ESS_MS_Intern_User) authentication provider
Inheritance
System.Object
DbAuthenticationProvider
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Simplic.Framework.Base.Auth
Assembly: Simplic.Framework.Base.dll
Syntax
public class DbAuthenticationProvider : IAuthenticationProvider
Constructors
| Improve this Doc View SourceDbAuthenticationProvider(IUserService)
Initialize service
Declaration
public DbAuthenticationProvider(IUserService userService)
Parameters
Type | Name | Description |
---|---|---|
IUserService | userService | User service |
Methods
| Improve this Doc View SourceAuthorizeAsync(IIdentity)
Authorize a user and get its principal
Declaration
public async Task<UserPrincipal> AuthorizeAsync(IIdentity identity)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IIdentity | identity | User identity instance |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserPrincipal> | Principal instance |
LoginAsync(String, String)
Login a user and return its identity
Declaration
public async Task<UserIdentity> LoginAsync(string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | User name |
System.String | password | Password |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserIdentity> | Identity instance if the user exsits, else null |
LoginByApiKeyAsync(String, String)
Login a user using an API key and return its identity.
Declaration
public async Task<UserIdentity> LoginByApiKeyAsync(string userName, string apiKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | |
System.String | apiKey |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserIdentity> |