Mati M.
2013-May-21 19:08 UTC
How to develop an authentication/authorization plugin that I can use for multiple projects
I am a newbie for RoR but I liked it so far. For the current project I already developed an authenticaion page where the user will be authenticated before and after login. I know that I will be doing more projects on RoR in the coming weeks as well and I don''t want to copy paste my codes to enable authentication in my projects. How can I create an authentication system where I can use it in multiple projects. Are there any plugins already been developed? You should also consider that, the authentication system also be on call (it should be listening everytime the user goes from one page to another page by checking if s/he is authorized and also the session haven''t expired yet and so on.). That means I still need the authentication/authorization system to be there even after login. And how do I integrate it with other ruby projects I will be working on. I hope it makes sense. The database where users will be authorized might be the same or different based on the projects. Thank you -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/73b37faf9d7ea307dd8b289afd14fa81%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Robert Walker
2013-May-21 19:21 UTC
Re: How to develop an authentication/authorization plugin that I can use for multiple projects
Mati M. wrote in post #1109763:> I am a newbie for RoR but I liked it so far. For the current project I > already developed an authenticaion page where the user will be > authenticated before and after login. I know that I will be doing more > projects on RoR in the coming weeks as well and I don''t want to copy > paste my codes to enable authentication in my projects. How can I create > an authentication system where I can use it in multiple projects. Are > there any plugins already been developed?http://guides.rubygems.org/make-your-own-gem/ FYI: Most newcomers, and veterans alike, don''t typically reinvent the authentication wheel. They instead use one of the excellent authentication gems that already exist. https://github.com/plataformatec/devise https://github.com/intridea/omniauth> You should also consider that, the authentication system also be on > call (it should be listening everytime the user goes from one page to > another page by checking if s/he is authorized and also the session > haven''t expired yet and so on.). That means I still need the > authentication/authorization system to be there even after login. And > how do I integrate it with other ruby projects I will be working on. I > hope it makes sense. > > The database where users will be authorized might be the same or > different based on the projects.You''re really talking about two separate things here. Authentication and Authorization. I personally use OmniAuth for authentication and CanCan for authorization. To me this is an excellent combination for most of my needs. https://github.com/ryanb/cancan -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/431ab0667ad07da0229cf0257f530241%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Mati M.
2013-May-21 19:38 UTC
Re: How to develop an authentication/authorization plugin that I can use for multiple projects
Thanks Robert. So can I use https://github.com/ryanb/cancan for both authentication and authorization ? Or do I have to use 2 gems? Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b116c318230787b7c01386e764148f6d%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Mati M.
2013-May-21 19:38 UTC
Re: How to develop an authentication/authorization plugin that I can use for multiple projects
> > You''re really talking about two separate things here. Authentication and > Authorization. I personally use OmniAuth for authentication and CanCan > for authorization. To me this is an excellent combination for most of my > needs. > > https://github.com/ryanb/cancanThanks Robert. So can I use https://github.com/ryanb/cancan for both authentication and authorization ? Or do I have to use 2 gems? Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/0078f21e8a7df294547942697ed706d0%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Robert Walker
2013-May-21 20:35 UTC
Re: How to develop an authentication/authorization plugin that I can use for multiple projects
Mati M. wrote in post #1109768:>> >> You''re really talking about two separate things here. Authentication and >> Authorization. I personally use OmniAuth for authentication and CanCan >> for authorization. To me this is an excellent combination for most of my >> needs. >> >> https://github.com/ryanb/cancan > > Thanks Robert. > > So can I use https://github.com/ryanb/cancan for both authentication > and authorization ? Or do I have to use 2 gems?CanCan is agnostic about authentication. It assumes you have a current_user method by default (the name can be customized to whatever your authentication system provides). This is actually a good thing. It''s just good programming practice, in general, to separate concerns this way. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/73c701414cac6d7e8185cca52b71734e%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Wins Lin
2013-May-22 19:37 UTC
Re: How to develop an authentication/authorization plugin that I can use for multiple projects
Cancan has 166 open issues on Github -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/e94182236029312fdbbebc5748f4b83e%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Robert Walker
2013-May-22 20:08 UTC
Re: How to develop an authentication/authorization plugin that I can use for multiple projects
Wins Lin wrote in post #1109864:> Cancan has 166 open issues on GithubThe Linux Kernel currently has 1789 open issues. So what''s you point? Are you saying CanCan is broken? -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1ec0b2b9704c8425c7d3021aff6fffc1%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.
Robert Walker
2013-May-22 20:24 UTC
Re: How to develop an authentication/authorization plugin that I can use for multiple projects
Robert Walker wrote in post #1109869:> Wins Lin wrote in post #1109864: >> Cancan has 166 open issues on Github > > The Linux Kernel currently has 1789 open issues. So what''s you point? > Are you saying CanCan is broken?BTW that was a serious question. Might have sounded like I was being a smart ass, but I''m using CanCan and I really need to know if the current 1.6.10 version is really broken. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a0a2fa98247e24cd9b8d136f903e76a3%40ruby-forum.com?hl=en-US. For more options, visit https://groups.google.com/groups/opt_out.