I need to add OAuth2 authentication to a Sinatra-based API. No ActiveRecord, no MongoDB... but DataMapper.
Does anybody know what gems I can use to achieve this? I added rack-oauth2-server, but it depends on Mongo. I'm trying to understand rack-oauth2, but there is practically no documentation and I can't see how this is supposed to integrate in a real application that provides oauth authentication. Any well-documented gems out there? (Not Rails gems).
omniauth-oauth2 looked like it would work, but again, there's basically no documentation on how to integrate it. Links to articles that outline integration with these gems would also be useful.
I've been searching all day and just keep going around in circles. I'm sure this is a solved problem.
Why you didn't look at http://rubydoc.info/gems/oauth2/0.7.1/frames?
Related
I'm building my first web app, and I've got all these crazy ideas on ways I could handle things like logins/sessions, but I was wondering if anyone has written a really good, thorough description of how logins/sessions work. I've seen tutorials, but I want to know if theres something more abstract that gives the reader a more general idea of how the whole process is handled. My web app is in ruby/sinatra if that's relevant.
Most of the in-depth tutorials for login/authentication from scratch are for Rails unfortunately. I went through the same trouble trying to find Sinatra specific tutorials. I would recommend just checking out the rails oriented tutorials since the knowledge is pretty general and can be applied to Sinatra as well.
These guides from RailsGuides are pretty good for getting an understanding of authentication even though they are Rails specific (read the section on security especially):
http://guides.rubyonrails.org/
Here's an example of a good Sinatra authentication scheme on github (it uses the datamapper gem, but you can easily replace this with any other Ruby ORM):
https://github.com/daddz/sinatra-dm-login
If you aren't as interested in rolling your own, you can also try the sinatra-authentication gem:
https://github.com/maxjustus/sinatra-authentication
I have a app which runs on ruby on rails and mysql database. I need to generate couple of reports. Presently I am generating csv file but my Idea is to integrate with the google docs, as soon as a user opens a particular doc automatically it has to sync with the my rails app and fetch the data from the database and display in the google docs.
I need little heads up.I have gone through the docs, but couldn't figure out the way of doing it.
Thanks
Check out the to_google_spreadsheets gem. It is well documented and seems to have all the functionality you are looking for.
Cheers,
Sean
You will need to write an onOpen in your gdoc. From there call urlfetch to your app.
Any practical advice or experience on integration of tabs_on_rails or tabulous and devise with Twitter Bootstrap? I'm starting a new project and would like to pick a tab navigation gem. I'v started to experiment with formtastic-bootstrap as well.
I created tabulous and would like for it to work well with devise. I recently threw together an example app with tabulous with devise and didn't come across any obvious incompatibilities between the two. If there are any issues with using devise with tabulous I'd like to know about them so that I can fix them.
I am currently working on a rails 3.1 app that is going to be in the wild soon. I need to add captcha's to a couple of the pages (reset password etc). I think I have decided to go with recaptcha's service but I'm stuck trying to decide which gem to use. The two obvious options are:
ambethia / recaptcha: https://github.com/ambethia/recaptcha
and
rack-recapcha https://github.com/achiu/rack-recaptcha
Does anyone have any experience / suggestions as to which works better with rails 3.1?
I'm succesfully using ambethia/recaptcha.
The main thing is neither of them are using the asset pipeline from rails 3.1.
Anyhow ambethia/recaptcha. works fine.
I'm going to add Oauth autenthication to my rails web app. Since I don't want to reinvent the wheel, have you got some ruby gem to suggest to add this kind of feature?
TIA
Paolo
I would say that this advice is now superseded. I'd suggest you use OmniAuth instead, possibly with Devise if you need normal auth as well.
There are 2 OmniAuth specific RailsCasts that walk you through exactly what's needed: OmniAuth Part 1 and OmniAuth Part 2
Have a look at these:
Pelle's plugin at github tutorial is here
and the second one is oauth2 with some examples
Petr