Bubble Foundry

Posts tagged with: authentication

Connecting to a Mongo database with Casbah
Because I’ve wasted too much time on Casbah tonight, I have to pass it on. Simply, not much is done for you automatically. Connect like this: val uri = MongoURI("mongodb://username:password@server:port/database") val mongo = MongoConnection(uri) val db = mongo(uri.database) db.authenticate(uri.username, uri.password.foldLeft("")(_ + _.toString)) val collection = db("something") If you call db.authenticate() a second time it will […] Read more – ‘Connecting to a Mongo database with Casbah’.
Authenticating Requests in Lift Using HTTP Dispatch Guards
The canonical – I’m making a leap to say that, but why not – way to add REST APIs to a Lift app is to append them to one of the app’s dispatch tables, either stateful or stateless. David and Tim have examples of using them to ensure a user is logged in, however both […] Read more – ‘Authenticating Requests in Lift Using HTTP Dispatch Guards’.