Hi,
Just create a WIF STS website, and this is a empty anthentication site, you have to add your code logic to authenticate users' info and give a response.
Yes On-premise sql server can also works for your custom STS, but you need to make sure cross-domain request works in your sample and VM.
If you want a full sample code to show how to do that, try to post your sample request to Microsoft All-In-One Code Framework, i believe they will give a quick response to you.
http://1code.codeplex.com/workitem/list/basic
Hope this helps.
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact
msdnmg@microsoft.com
Microsoft One Code Framework