hope you all doing well.
my question is on ruby technology, we are developing an web based application using rails framework and ruby. I need to know how the routing works (routes.rb), can some one send me a link of sample CRUD application which I can use in my project.
I need also User authentication and authorization framework using ruby which is readily available.
very urgent,
many many thanks :)
Basically, you are asking how Ruby on Rails works and how to getting started.
I encourage you to start from the official documentation, including the Wiki site and Guides.
You can find information about Rails routing here. More answers about Rails Authentication and Authorization here and here.
For a quick way of creating a Rails CRUD application with user authentication and authorization, please see the Bullet on Rails project. Bullet on Rails is a project I created a while ago to help me quick start creating CRUD apps with authorization included and AJAX crud.
Since you seem to be new to Rails, I also recommend that you read the documentation suggested by weppos.
Related
Are there any good tutorial to create an auth system from scraths with form and api authentication?
I found a lot of tutorial but unfortunately they implement only form based or only api based authentication.
But I would like to build a form and api based.
Because for the SEO the server side rendering is important so I can create a registration and login form too. But API based important for a mobile app application.
Here are some resources, that you might find useful. I have used the first one frequently in the past.
http://railscasts.com/episodes/250-authentication-from-scratch
https://gist.github.com/thebucknerlife/10090014
https://rubyplus.com/articles/4171-Authentication-from-Scratch-in-Rails-5
https://www.sitepoint.com/rails-userpassword-authentication-from-scratch-part-i/
How to create authentication from scratch in rails 4
I hope this gives you some inspiration.
Using Ruby on Rails, I've been trying to find best practices for building an authentication API in order to ensure security. Are there guidelines or aspects I should pay attention to?
You should use gems for authentication Devise or AuthLogic. They're quite good, have a lot of functionality and are extendable. Devise has RESTful API. Have a look inside the code.
There is RubyOnRails application with Devise authentication. Is there any smart way to add ruby Cramp framework to that application with devise support?
One devise session for both rails and cramp
I am assuming that you want to run Cramp for something like chat within your application. If you provided more info about what you are trying to accomplish, it would help get you a more appropriate answer. If you're building a chat tool, or some kind of stat logging service, it would probably make more sense to build it outside of Rails and integrate the two through an API. Just a thought.
I am developing an API in Ruby on Rails 3 and I would like to secure it with Oauth2.
In other words, I need to create an Oauth provider. Is there a working gem for Rails 3 out there or perhaps a tutorial on the issue?
UPDATE
I know Rails are REST based so I find it very strange that there are no tutorials on how to create a public API and secure it. Does anyone know of any good tutorials. Preferable with oAuth.
Thankful for all help!!
Check out this gem https://github.com/applicake/doorkeeper
It is for Rails 3, the development it's early stages though.
There's also an example app that you take a look and see how the API is done.
http://doorkeeper-provider.herokuapp.com/
I've opensourced an OAuth2 server implementation yesterday.
It's well documented and there is a dashboard to control accesses. Right now I'm searching for somebody who wants to build an engine starting from it, or something cool on top of rack. That's why it is open-source.
https://github.com/intridea/oauth2 is the canonical gem right now for OAuth2 dev. If you are looking for a more complete solution, instead of rolling your own provider code, check out:
https://github.com/songkick/oauth2-provider
https://github.com/freerange/oauth2-provider
But I suggest messing around with the oauth2 gem if you aren't very familiar with the flow so that you can learn it better.
If you are using (or planning to use) devise for authentication, you can use https://github.com/socialcast/devise_oauth2_providable as plugin.
I'm developing a rugygem for OAuth2 provider, Rack::OAuth2.
https://github.com/nov/rack-oauth2
It requires to develop models (token, code, client etc) by yourself, but you can get a whole Rails3 sample OAuth2 server here.
https://github.com/nov/rack-oauth2-sample
I'm looking to implement an OAuth2 provider, too! I'm currently experimenting with this https://github.com/assaf/rack-oauth2-server, which seems to be a full-featured OAuth2 server, though it still supports only MongoDB, although implementing support for other DBMS seems simple enough. I am also looking at some of the other options posted here, lots of promising stuff!
"Doorkeeper is a gem that makes it easy to introduce OAuth 2 provider functionality to your application."
https://github.com/applicake/doorkeeper
Im starting to learn RoR and i want to make my personal blog in this language. I usually code a couple of prototypes on top of whatever im doing in my blog. So i would like people to be able to log in, and register with their openID. So i was about to jump to the coding place when i realized the concept of gems and all that stuff is giving you tools for this kind of things.
So is there some kind of package to manage users, profiles and openId?
check out technoweeni's restful-authentication plugin
I'd advise you to look at bort as a complete RoR skeletton app with RESTful auth builtin, one of its fork here or at AuthLogic a less intrusive auth solution for Rails (and Merb and some others).
Take a look at the bort skeleton app. It has restful auth and openid authentication already setup among other things.
Railscasts also has a number of screencasts about setting up authentication, restful authentication and OpenID.
One thing you want to be aware of to avoid hours of headache: the Ruby OpenID library changed substantially with OpenID 2.0, so if you're using a plugin or example code from a blog, be sure you're using the version of OpenID to which it corresponds.
There are several plugins; one with lot of activity is open_id_authentication.
Dan Webb has a good guide to OpenID authentication in Rails that walks you through writing the actual code, but note that, at least last I checked, it hadn't been updated for OpenID 2.0.