Jorge Aliss has asked me (about 3 months ago, mea culpa) to write an example application that integrates the Deadbolt authorization module with his excellent SecureSocial module.
The application is currently in development as I take a five minute break to write this, and I thought I would share a handy shortcut for developing your own SecureSocial apps on your local box.
If you’re using, for example, Twitter to provide your OAuth service then you’ll need to provide a callback URL. Since you’re on your local computer, which doesn’t necessarily have its own external IP address then there are a couple of hacks you can use. One involves changing your hosts file to resolve an external URL to your local server.
Another, far easier – and lazier – method, is to use a URL shortener to provide the same situation. bit.ly doesn’t seem to allow request parameters, but goo.gl does. Simply create a shortened URL for http://localhost:9000/securesocial.securesocial/authenticate?type=twitter (adjust as necessary for port, OAuth provider, etc) and use that as the callback address in the application your register with the OAuth provider.
4 thoughts on “Using SecureSocial in your local dev environment”
here’s another article on securesocial: http://playlatam.wordpress.com/2012/02/20/secure-json-services-with-play-scala-and-securesocial-by-matt-raible/
Great tip indeed! By the way is it possible at all to make this scenario with URL shorteners work with Google provider?
According to Jorge, “cool hack. that won’t work for Google auth but will help with others. I use dyndns in my dev environment.”