Interface ILoginService
- Namespace
- adas_core.Authentication.Interfaces
- Assembly
- adas-core.Authentication.dll
public interface ILoginService
- Extension Methods
Properties
AllowPassword
bool AllowPassword { get; }
Property Value
Method
UserEnum.LoginMethod Method { get; }
Property Value
Methods
Authenticate(string, string)
Authenticates a user based on the provided credentials.
Task<User> Authenticate(string username, string password)
Parameters
usernamestringThe username of the user to authenticate.
passwordstringThe password of the user to authenticate.
Returns
- Task<User>
A task that represents the asynchronous operation. The task result contains the authenticated User.
GetAllUsers()
Asynchronously retrieves a list of all users in the system.
Task<List<User>> GetAllUsers()
Returns
- Task<List<User>>
A task that represents the asynchronous operation, containing a list of all User entities.
GetByEmail(string)
Retrieves a user from the data store by their email address, or returns null if no matching user is found.
Task<User?> GetByEmail(string email)
Parameters
emailstringThe email address used to look up the user.
Returns
- Task<User>
A task that resolves to the User matching the provided email, or null if no user is found.
GetById(ObjectId)
Retrieves a user by their unique identifier, returning null if no matching user is found.
Task<User?> GetById(ObjectId id)
Parameters
idObjectIdThe unique identifier of the user to look up.
Returns
GetByUsername(string)
Retrieves a user by their username asynchronously, returning null if no matching user is found.
Task<User?> GetByUsername(string username)
Parameters
usernamestringThe username to look up.
Returns
- Task<User>
A Task<TResult> that resolves to the matching User, or
nullif no user exists with the specified username.
Login(HttpContext)
Authenticates a user based on the provided HTTP context.
Task<User> Login(HttpContext context)
Parameters
contextHttpContextThe HTTP context containing the request information used to perform the login.
Returns
- Task<User>
A task that represents the asynchronous login operation. The task result contains the authenticated User.
Login(string, string)
Authenticates a user with the provided credentials and returns the corresponding user account.
Task<User> Login(string username, string password)
Parameters
usernamestringThe username of the user attempting to log in.
passwordstringThe password associated with the username.
Returns
- Task<User>
A Task<TResult> representing the asynchronous operation, containing the authenticated User.