Background: - Using Web API in a Web Forms app with ASP.Net 4.0/C# using VS 2012 - Some pages will use Web API calls with JQuery, others will use web forms postbacks
Need to do the following:
- Have user login with username/password
- Validate credentials with SQL Server DB
- Generate token back to client
- Have client use token to authenticate on future API requests
- Maintain user session regardless if using Web API or web form postback
What I'm not clear about is:
- How to generate token using Web API
- How to validate the token server-side on each call (store in SQL Server?)
- How to maintain user session with a mix of Web API/web form postbacks