I am developing an ASP.NET MVC 4 site on .NET 4.0. I am trying to verify the authenticity of the site on the WEB API. Now the site will transmit the username and password, and the WEB API will authenticate it. If authenticated, the WEB API will return a token with roles, Time To Live, etc. I am looking for a few pointers on this.
1.) How to generate this token? I do not want to use STS or anything else. Even an approach with unfair evidence. 2.) On the MVC side, should I get this token and set the current session as authenticated and make sure that with the expiration of the TTL I am redirecting the user to the login page? Also in all WEB API requests I need to send this token.
source
share