Adding OAuth to the Scalatra Web Service

I want to create a Scalatra based API. One of the requirements is OAuth authentication. I noticed that the manual for OAuth has not yet been posted on the Scalatra official website. Best way to add OAuth support by figuring out how to add an OAuth strategy to Warden? I came from a Ruby on Rails-based background so new to many w60> / Java conventions. There are probably several ways to solve this problem, but I hope for any solution that is documented and can be specified for implementation in my own application.

+7
source share
1 answer

I am currently rewriting the Ruby / Sinatra application in Scala / Scalatra. I found the easiest way to add OAuth is to use Scribe ( https://github.com/fernandezpablo85/scribe-java ). There is a guide to using Scribe with Scala here:

https://github.com/earldouglas/nuevos#consuming-the-twitter-api-in-scala-with-scribe

Please note that the exact implementation of the Twitter API is deprecated. He made some minor updates to the code without actually updating the README (this has confused me for some time.) I suggest you read the normal Java Scribe manual first, and then take a look at the source code of the Scalatra example.

+1
source

All Articles