I'm developing a web application consuming a REST .NET Web API. My web API is stateless and I'm using static HTML and JQuery requests.
Question.... What's the best way to do the login/password autentication?
Application flow:
- API XHR request
- API response with status 401
- JS redirect to login page
- API Authentication XHR request (with login and password)
- API response with a token
- New API XHR request (with token)
- API response with data