I am in need of implementing Token based Authentication in my web api project. On Googling I came to know about JWT. But now its been a day on scratching my head and googling how to implement JWT for simple Forms Authenications.
The links that I found shows JWT with either OAuth or Identity framework.
But I am NOT using OAuth or Identity framework.
public HTTPStatusCode Login(string userName, string pwd)
{
if(userName!=null && pwd !=null)
{
IDAL dal = new AccountService();
bool isValid = dal.ValidateUser(userName,pwd); //simple dal method to check for the username & password
if(isValid)
{
//here I need to implement JWT.
return HTTPStatus.Ok;
}
else
{
return HTTPStatus.BadRequest;
}
}
}
Can somebody share some article that demonstrates how to impment JWT?