User696604810 posted
problem
which api functions I will need to make login ?
i need to know function or action must be done to achieve login with full functionality as following :
post
[HttpPost(Contracts.ApiRoutes.Login.UserLogin)]
public IActionResult PostUserLogins([FromBody]string username,[FromBody]string password)
{
* count attempt login and if exceed limit within in period lock account .
* check password expiration
validate user and password
if(isvalid)
return json
else
return json to failed
generate access token
}
only if possible i need pseudo code to what i will do .
make action to check expiredate password or make it inside function postuselogin and what nature get or post?
count attempt login is this will be on separate action or inside function postuserlogin and what nature get or post ?
validate user and password also and what nature of get or post ?
generate access token and what nature ?
the result expected as following json :
{
"request_status" : {
"status" : "succeeded",
"code": 0,
"message" : "login succeeded!"
},
"access_token" : "",
"user_data": {
"UserFullName" : "Ahmed",
"LoginTime" : "12",
"Admin" : "adil"
},
"branches": [
{
"BranchCode" : "1",
"BranchName":"Baha"
}
]
}
so how to write functions as above
public interface ISecurityService
{
what function here
}
public class SecurityService : ISecurityService
{
what i write here functions
}
public class SecurityController : Controller
{
readonly Services.ISecurityService _SecurityService;
public SecurityController(Services.ISecurityService securityService)
{
_SecurityService = securityService;
}
what i write here please type of action and functions
}