Interface IAuthenticationProvider
Interface for any authentication provider
Namespace: Simplic.Framework.Base.Auth
Assembly: Simplic.Framework.Base.dll
Syntax
public interface IAuthenticationProvider
Methods
| Improve this Doc View SourceAuthorizeAsync(IIdentity)
Get the principal which belongs to authenticated user
Declaration
Task<UserPrincipal> AuthorizeAsync(IIdentity identity)
Parameters
Type | Name | Description |
---|---|---|
System.Security.Principal.IIdentity | identity | Identity instance for authorization |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserPrincipal> | Principal if valid identity, else null |
LoginAsync(String, String)
Login a user and return it's identity
Declaration
Task<UserIdentity> LoginAsync(string userName, string password)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | Unique username |
System.String | password | Not hashed password |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserIdentity> | identity if found and valid, else null |
LoginByApiKeyAsync(String, String)
Login a user by API key and return it's identity.
Declaration
Task<UserIdentity> LoginByApiKeyAsync(string userName, string apiKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | userName | Unique username |
System.String | apiKey | API key |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UserIdentity> | identity if found and valid, else null |