Gokul's Blog


Leave a comment

XSD to table generator

http://stackoverflow.com/questions/2628327/how-to-build-a-database-from-an-xsd-schema-and-import-xml-data

http://stackoverflow.com/questions/138575/how-can-i-create-database-tables-from-xsd-files

http://alearningdeveloper.wordpress.com/2011/03/31/creating-database-from-xsd-file/

http://stackoverflow.com/questions/403420/convert-xsd-into-sql-relational-tables

Advertisements


Leave a comment

ServiceStack custom authentication

A good explanation on using ServiceStack custom authentication & CORS

Coding in the cloud

I learned a lot from trying to get a ServiceStack authenticate remote ajax requests. (Alternative text: “I spent a lot of hours in frustration…”)

In the end the solution is simple and does not require many lines of code.

[ Edit : see also this gist https://gist.github.com/4518393 ]

When you try to access a remote resource with ajax you will get an error saying:

Enable CORS

That is easy to deal with in ServiceStack just by adding a plugin in your AppHost Configure method:

Add Custom Authentication

If you like to use custom authentication you add a CustomCredentialsAuthProvider just like in the example in this page : https://github.com/ServiceStack/ServiceStack/wiki/Authentication-and-authorization. And then enable it with this code in Configure:

Now you should be able to try login using the default url :

Require authentication

To make a resource require authentication, just add the authenticate attribute on the DTO, on the service…

View original post 328 more words