AuthenticationService¶
Namespace: Rest_API.Services.Auth
Inheritance Object → AuthenticationService
Implements IAuthenticationService
Constructors¶
AuthenticationService(ILogger<AuthenticationService>, UserManager<ApiUser>, RoleManager<IdentityRole>, ITokenService, ITokenRepo)¶
public AuthenticationService(ILogger<AuthenticationService> logger, UserManager<ApiUser> userManager, RoleManager<IdentityRole> roleManager, ITokenService tokenService, ITokenRepo tokenRepo)
Parameters¶
logger
ILogger<AuthenticationService>
userManager
UserManager<ApiUser>
roleManager
RoleManager<IdentityRole>
tokenService
ITokenService
tokenRepo
ITokenRepo
Methods¶
ChangePassword(ApiUser, String, String)¶
Changes the password of a user.
Parameters¶
user
ApiUser
The Object of the user.
currentPassword
String
The current password of the user.
newPassword
String
The new password to set.
Returns¶
A task that represents the asynchronous operation. The task result contains a message
indicating the result of the password change.
Exceptions¶
Exception
Thrown when the password change fails.
ChangeUser(ApiUser)¶
Changes the username of a user.
Parameters¶
user
ApiUser
The User Object of the user.
Returns¶
A task that represents the asynchronous operation. The task result contains a message
indicating the result of the username change.
Exceptions¶
Exception
Thrown when the username change fails.
DeleteUser(ApiUser)¶
Parameters¶
user
ApiUser
Returns¶
GetUserById(String)¶
Parameters¶
userId
String
Returns¶
GetUserInformations()¶
Returns¶
Login(Login)¶
Parameters¶
input
Login
Returns¶
RefreshToken(JwtToken)¶
Parameters¶
tokenModel
JwtToken
Returns¶
Register(Register)¶
Parameters¶
input
Register