Hello, Im trying to write a simple app for company internal usage. The other applications we use (in php) authenticate users based on database credentials, and to be honest I have no idea how to implement this. Any suggestions will be great! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Take a look at the devise gem: https://github.com/plataformatec/devise On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, Im trying to write a simple app for company internal usage. > The other applications we use (in php) authenticate users based on > database credentials, and to be honest I have no idea how to implement > this. Any suggestions will be great! > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I read README, and i don''t see anywere it provides solution I need. Let me clarify, username and password combination must be same as DATABASE permission (set by db engine). It has nothing to to do with content on that database itself. 2012/1/30 Everaldo Gomes <everaldo.gomes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Take a look at the devise gem: > > https://github.com/plataformatec/devise > > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> Hello, Im trying to write a simple app for company internal usage. >> The other applications we use (in php) authenticate users based on >> database credentials, and to be honest I have no idea how to implement >> this. Any suggestions will be great! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
What do you mean by database here, Do you need something like LDAP authentication? On Jan 30, 10:25 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I read README, and i don''t see anywere it provides solution I need. > > Let me clarify, username and password combination must be same as > DATABASE permission (set by db engine). > It has nothing to to do with content on that database itself. > > 2012/1/30 Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > > > > > Take a look at the devise gem: > > >https://github.com/plataformatec/devise > > > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> Hello, Im trying to write a simple app for company internal usage. > >> The other applications we use (in php) authenticate users based on > >> database credentials, and to be honest I have no idea how to implement > >> this. Any suggestions will be great! > > >> -- > >> You received this message because you are subscribed to the Google Groups > >> "Ruby on Rails: Talk" group. > >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. > >> To unsubscribe from this group, send email to > >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> For more options, visit this group at > >>http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No, I think... Its like every db on server have its own set of permissions for different users ,right? And i want to authenticate user based on that permissions. 2012/1/30 venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> What do you mean by database here, Do you need something like LDAP > authentication? > > On Jan 30, 10:25 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I read README, and i don''t see anywere it provides solution I need. >> >> Let me clarify, username and password combination must be same as >> DATABASE permission (set by db engine). >> It has nothing to to do with content on that database itself. >> >> 2012/1/30 Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> >> >> >> >> >> >> > Take a look at the devise gem: >> >> >https://github.com/plataformatec/devise >> >> > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> >> Hello, Im trying to write a simple app for company internal usage. >> >> The other applications we use (in php) authenticate users based on >> >> database credentials, and to be honest I have no idea how to implement >> >> this. Any suggestions will be great! >> >> >> -- >> >> You received this message because you are subscribed to the Google Groups >> >> "Ruby on Rails: Talk" group. >> >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. >> >> To unsubscribe from this group, send email to >> >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> For more options, visit this group at >> >>http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> > -- >> > You received this message because you are subscribed to the Google Groups >> > "Ruby on Rails: Talk" group. >> > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. >> > To unsubscribe from this group, send email to >> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > For more options, visit this group at >> >http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
There are many free DB UI tools available. Choose suitable one for your db choice. On Tue, Jan 31, 2012 at 12:36 AM, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No, I think... > > Its like every db on server have its own set of permissions for > different users ,right? > And i want to authenticate user based on that permissions. > > > > 2012/1/30 venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > What do you mean by database here, Do you need something like LDAP > > authentication? > > > > On Jan 30, 10:25 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I read README, and i don''t see anywere it provides solution I need. > >> > >> Let me clarify, username and password combination must be same as > >> DATABASE permission (set by db engine). > >> It has nothing to to do with content on that database itself. > >> > >> 2012/1/30 Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > >> > >> > >> > >> > >> > >> > >> > >> > Take a look at the devise gem: > >> > >> >https://github.com/plataformatec/devise > >> > >> > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > >> > >> >> Hello, Im trying to write a simple app for company internal usage. > >> >> The other applications we use (in php) authenticate users based on > >> >> database credentials, and to be honest I have no idea how to > implement > >> >> this. Any suggestions will be great! > >> > >> >> -- > >> >> You received this message because you are subscribed to the Google > Groups > >> >> "Ruby on Rails: Talk" group. > >> >> To post to this group, send email to > rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> >> To unsubscribe from this group, send email to > >> >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> >> For more options, visit this group at > >> >>http://groups.google.com/group/rubyonrails-talk?hl=en. > >> > >> > -- > >> > You received this message because you are subscribed to the Google > Groups > >> > "Ruby on Rails: Talk" group. > >> > To post to this group, send email to > rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> > To unsubscribe from this group, send email to > >> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> > For more options, visit this group at > >> >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > > You received this message because you are subscribed to the Google > Groups "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- sαη∂ιρ Rαηѕιηg --- www.funonrails.com twitter, github @sandipransing skype sandip.ransing -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I don''t see how db configuration UI might help me on this. maybe as example, at best 2012/1/30 sandip ransing <sandip-cm2wsEbV6oregbzhZkK2zA@public.gmane.org>:> There are many free DB UI tools available. Choose suitable one for your db > choice. > > > On Tue, Jan 31, 2012 at 12:36 AM, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> No, I think... >> >> Its like every db on server have its own set of permissions for >> different users ,right? >> And i want to authenticate user based on that permissions. >> >> >> >> 2012/1/30 venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> > What do you mean by database here, Do you need something like LDAP >> > authentication? >> > >> > On Jan 30, 10:25 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >> I read README, and i don''t see anywere it provides solution I need. >> >> >> >> Let me clarify, username and password combination must be same as >> >> DATABASE permission (set by db engine). >> >> It has nothing to to do with content on that database itself. >> >> >> >> 2012/1/30 Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > Take a look at the devise gem: >> >> >> >> >https://github.com/plataformatec/devise >> >> >> >> > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> >> >> > wrote: >> >> >> >> >> Hello, Im trying to write a simple app for company internal usage. >> >> >> The other applications we use (in php) authenticate users based on >> >> >> database credentials, and to be honest I have no idea how to >> >> >> implement >> >> >> this. Any suggestions will be great! >> >> >> >> >> -- >> >> >> You received this message because you are subscribed to the Google >> >> >> Groups >> >> >> "Ruby on Rails: Talk" group. >> >> >> To post to this group, send email to >> >> >> rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> >> To unsubscribe from this group, send email to >> >> >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> >> For more options, visit this group at >> >> >>http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> >> >> > -- >> >> > You received this message because you are subscribed to the Google >> >> > Groups >> >> > "Ruby on Rails: Talk" group. >> >> > To post to this group, send email to >> >> > rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> > To unsubscribe from this group, send email to >> >> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> >> > For more options, visit this group at >> >> >http://groups.google.com/group/rubyonrails-talk?hl=en. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Ruby on Rails: Talk" group. >> > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. >> > To unsubscribe from this group, send email to >> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > For more options, visit this group at >> > http://groups.google.com/group/rubyonrails-talk?hl=en. >> > >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > sαη∂ιρ Rαηѕιηg > > --- > www.funonrails.com > > twitter, github @sandipransing > skype sandip.ransing > > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 30 January 2012 19:06, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No, I think... > > Its like every db on server have its own set of permissions for > different users ,right? > And i want to authenticate user based on that permissions.Do you mean you want to connect to the database using the name and password used by user to login, or do you want to prevent the user from logging in unless he uses a valid name/password configured for the db, or both? Colin> > > > 2012/1/30 venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> What do you mean by database here, Do you need something like LDAP >> authentication? >> >> On Jan 30, 10:25 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> I read README, and i don''t see anywere it provides solution I need. >>> >>> Let me clarify, username and password combination must be same as >>> DATABASE permission (set by db engine). >>> It has nothing to to do with content on that database itself. >>> >>> 2012/1/30 Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >>> >>> >>> >>> >>> >>> >>> >>> > Take a look at the devise gem: >>> >>> >https://github.com/plataformatec/devise >>> >>> > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>> >> Hello, Im trying to write a simple app for company internal usage. >>> >> The other applications we use (in php) authenticate users based on >>> >> database credentials, and to be honest I have no idea how to implement >>> >> this. Any suggestions will be great! >>> >>> >> -- >>> >> You received this message because you are subscribed to the Google Groups >>> >> "Ruby on Rails: Talk" group. >>> >> To post to this group, send email to rubyonrails-talk@googlegroups.com. >>> >> To unsubscribe from this group, send email to >>> >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> >> For more options, visit this group at >>> >>http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >>> > -- >>> > You received this message because you are subscribed to the Google Groups >>> > "Ruby on Rails: Talk" group. >>> > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. >>> > To unsubscribe from this group, send email to >>> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> > For more options, visit this group at >>> >http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> -- >> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- gplus.to/clanlaw -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
That would be second option. 2012/1/30 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>:> On 30 January 2012 19:06, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> No, I think... >> >> Its like every db on server have its own set of permissions for >> different users ,right? >> And i want to authenticate user based on that permissions. > > Do you mean you want to connect to the database using the name and > password used by user to login, or do you want to prevent the user > from logging in unless he uses a valid name/password configured for > the db, or both? > > Colin > >> >> >> >> 2012/1/30 venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >>> What do you mean by database here, Do you need something like LDAP >>> authentication? >>> >>> On Jan 30, 10:25 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> I read README, and i don''t see anywere it provides solution I need. >>>> >>>> Let me clarify, username and password combination must be same as >>>> DATABASE permission (set by db engine). >>>> It has nothing to to do with content on that database itself. >>>> >>>> 2012/1/30 Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> > Take a look at the devise gem: >>>> >>>> >https://github.com/plataformatec/devise >>>> >>>> > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> >>>> >> Hello, Im trying to write a simple app for company internal usage. >>>> >> The other applications we use (in php) authenticate users based on >>>> >> database credentials, and to be honest I have no idea how to implement >>>> >> this. Any suggestions will be great! >>>> >>>> >> -- >>>> >> You received this message because you are subscribed to the Google Groups >>>> >> "Ruby on Rails: Talk" group. >>>> >> To post to this group, send email to rubyonrails-talk@googlegroups.com. >>>> >> To unsubscribe from this group, send email to >>>> >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> >> For more options, visit this group at >>>> >>http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>>> > -- >>>> > You received this message because you are subscribed to the Google Groups >>>> > "Ruby on Rails: Talk" group. >>>> > To post to this group, send email to rubyonrails-talk@googlegroups.com. >>>> > To unsubscribe from this group, send email to >>>> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> > For more options, visit this group at >>>> >http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >>> -- >>> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > > > -- > gplus.to/clanlaw > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 31 January 2012 07:53, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That would be second option.Since you have top posted everyone will have to scroll down to see which that is. I will repeat it here to make it easier for those reading it:>> prevent the user from logging in unless he uses a valid name/password configured for the dbThe only way I can think of doing that is to attempt to connect to re-connect to the db when he logs in, using his credentials, and see if it successful. Colin> > 2012/1/30 Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>: >> On 30 January 2012 19:06, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> No, I think... >>> >>> Its like every db on server have its own set of permissions for >>> different users ,right? >>> And i want to authenticate user based on that permissions. >> >> Do you mean you want to connect to the database using the name and >> password used by user to login, or do you want to prevent the user >> from logging in unless he uses a valid name/password configured for >> the db, or both? >> >> Colin >> >>> >>> >>> >>> 2012/1/30 venkata reddy <venkatareddy.cs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >>>> What do you mean by database here, Do you need something like LDAP >>>> authentication? >>>> >>>> On Jan 30, 10:25 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> I read README, and i don''t see anywere it provides solution I need. >>>>> >>>>> Let me clarify, username and password combination must be same as >>>>> DATABASE permission (set by db engine). >>>>> It has nothing to to do with content on that database itself. >>>>> >>>>> 2012/1/30 Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> > Take a look at the devise gem: >>>>> >>>>> >https://github.com/plataformatec/devise >>>>> >>>>> > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> >>>>> >> Hello, Im trying to write a simple app for company internal usage. >>>>> >> The other applications we use (in php) authenticate users based on >>>>> >> database credentials, and to be honest I have no idea how to implement >>>>> >> this. Any suggestions will be great! >>>>> >>>>> >> -- >>>>> >> You received this message because you are subscribed to the Google Groups >>>>> >> "Ruby on Rails: Talk" group. >>>>> >> To post to this group, send email to rubyonrails-talk@googlegroups.com. >>>>> >> To unsubscribe from this group, send email to >>>>> >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> >> For more options, visit this group at >>>>> >>http://groups.google.com/group/rubyonrails-talk?hl=en. >>>>> >>>>> > -- >>>>> > You received this message because you are subscribed to the Google Groups >>>>> > "Ruby on Rails: Talk" group. >>>>> > To post to this group, send email to rubyonrails-talk@googlegroups.com. >>>>> > To unsubscribe from this group, send email to >>>>> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>>> > For more options, visit this group at >>>>> >http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. >>>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org. >>>> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> >> >> -- >> gplus.to/clanlaw >> >> -- >> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- gplus.to/clanlaw -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 31 Jan 2012, at 10:43, Colin Law wrote:>> That would be second option. > > Since you have top posted everyone will have to scroll down to see > which that is. I will repeat it here to make it easier for those > reading it: >>> prevent the user from logging in unless he uses a valid name/ >>> password configured for the db > > The only way I can think of doing that is to attempt to connect to > re-connect to the db when he logs in, using his credentials, and see > if it successful.There is actually a way to just query the database. You haven''t said what database you''re using, but the procedure should be more or less the same once you figure out how your specific database stores things. In case of MySQL, you would basically have to establish a connection with the database "mysql" from some ActiveRecord model (using "establish_connection", search it at http://api.rubyonrails.org/), then make sure your ActiveRecord model connects to the "user" table (singular! so use self.table_name="user" in Rails 3 or set_table_name in Rails 2) witin that database. Then you can just use a method like: Rails 2.x def authenticate(login, passwd) self.first(:conditions => ["Login=? and Password=PASSWORD(?)", login, passwd]) end Rails 3.x def authenticate(login, passwd) self.where("Login=? and Password=PASSWORD(?)", login, passwd).first end This is completely untested and it''s an authentication method I''m not too fond of, but this is more or less how you could get it done. Best regards Peter De Berdt -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
http://railscasts.com/episodes/209-introducing-devise or even more fun: http://railscasts.com/episodes/235-omniauth-part-1 and http://railscasts.com/episodes/236-omniauth-part-2 On Jan 30, 11:36 am, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, Im trying to write a simple app for company internal usage. > The other applications we use (in php) authenticate users based on > database credentials, and to be honest I have no idea how to implement > this. Any suggestions will be great!-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Sounds like you want DB to tell you the roles people play and what permissions go with those roles. On Jan 30, 2:06 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No, I think... > > Its like every db on server have its own set of permissions for > different users ,right? > And i want to authenticate user based on that permissions. > > 2012/1/30 venkata reddy <venkatareddy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > > > > > What do you mean by database here, Do you need something like LDAP > > authentication? > > > On Jan 30, 10:25 pm, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I read README, and i don''t see anywere it provides solution I need. > > >> Let me clarify, username and password combination must be same as > >> DATABASE permission (set by db engine). > >> It has nothing to to do with content on that database itself. > > >> 2012/1/30 Everaldo Gomes <everaldo.go...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > >> > Take a look at the devise gem: > > >> >https://github.com/plataformatec/devise > > >> > On Mon, Jan 30, 2012 at 2:36 PM, Marcin S <msporys...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> >> Hello, Im trying to write a simple app for company internal usage. > >> >> The other applications we use (in php) authenticate users based on > >> >> database credentials, and to be honest I have no idea how to implement > >> >> this. Any suggestions will be great! > > >> >> -- > >> >> You received this message because you are subscribed to the Google Groups > >> >> "Ruby on Rails: Talk" group. > >> >> To post to this group, send email to rubyonrails-talk@googlegroups.com. > >> >> To unsubscribe from this group, send email to > >> >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> >> For more options, visit this group at > >> >>http://groups.google.com/group/rubyonrails-talk?hl=en. > > >> > -- > >> > You received this message because you are subscribed to the Google Groups > >> > "Ruby on Rails: Talk" group. > >> > To post to this group, send email to rubyonrails-talk@googlegroups.com. > >> > To unsubscribe from this group, send email to > >> > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > >> > For more options, visit this group at > >> >http://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
2012/1/31 Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org>:> > On 31 Jan 2012, at 10:43, Colin Law wrote: > >>> That would be second option. >> >> >> Since you have top posted everyone will have to scroll down to see >> which that is. I will repeat it here to make it easier for those >> reading it: >>>> >>>> prevent the user from logging in unless he uses a valid name/password >>>> configured for the db >> >> >> The only way I can think of doing that is to attempt to connect to >> re-connect to the db when he logs in, using his credentials, and see >> if it successful. > > > There is actually a way to just query the database. > > You haven''t said what database you''re using, but the procedure should be > more or less the same once you figure out how your specific database stores > things. > > In case of MySQL, you would basically have to establish a connection with > the database "mysql" from some ActiveRecord model (using > "establish_connection", search it at http://api.rubyonrails.org/), then make > sure your ActiveRecord model connects to the "user" table (singular! so use > self.table_name="user" in Rails 3 or set_table_name in Rails 2) witin that > database. Then you can just use a method like: > > Rails 2.x > def authenticate(login, passwd) > self.first(:conditions => ["Login=? and Password=PASSWORD(?)", login, > passwd]) > end > > Rails 3.x > def authenticate(login, passwd) > self.where("Login=? and Password=PASSWORD(?)", login, passwd).first > end > > This is completely untested and it''s an authentication method I''m not too > fond of, but this is more or less how you could get it done. > > > Best regards > > Peter De BerdtI''m using postgres. Yea I think thats what I''m looking for, already made some tests and it appears to be working - but we will see if there are any other consequences at later time. Thanks everyone for discuession. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I appreciate what you''re trying to do. I''ve been a dba in the past and have built apps using database credentials in the past. But this is a mistake. They key to being successful with rails is to leave behind the ways you did things before and embrace ''the rails way''. ActiveRecord using a single connection string to connect to the database -- it''s in the database.yml file in the /config directory. Having it somehow use different credentials based on the user would make things much more complicated than need be. My advice -- forget about how you did things before and embrace the powerful and fast tools that rails provides to do things. In this case, use ''device'' -- it''s what almost everyone else uses and you''ll thank yourself later for doing so. If you proceed with the way you''re going then later on you''ll kick yourself and wonder what the hell you were thinking. Best of luck. On Mon, Jan 30, 2012 at 11:36 AM, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, Im trying to write a simple app for company internal usage. > The other applications we use (in php) authenticate users based on > database credentials, and to be honest I have no idea how to implement > this. Any suggestions will be great! > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Jan 31, 2012 at 5:26 PM, Kevin Bedell <kbedell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> In this case, use ''device'' --Small detail, it''s ''devise'' (with an ''s''). https://github.com/plataformatec/devise Peter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
2012/1/31 Kevin Bedell <kbedell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> I appreciate what you''re trying to do. I''ve been a dba in the past and > have built apps using database credentials in the past. > > But this is a mistake. They key to being successful with rails is to > leave behind the ways you did things before and embrace ''the rails > way''. > > ActiveRecord using a single connection string to connect to the > database -- it''s in the database.yml file in the /config directory. > Having it somehow use different credentials based on the user would > make things much more complicated than need be. > > My advice -- forget about how you did things before and embrace the > powerful and fast tools that rails provides to do things. > > In this case, use ''device'' -- it''s what almost everyone else uses and > you''ll thank yourself later for doing so. If you proceed with the way > you''re going then later on you''ll kick yourself and wonder what the > hell you were thinking. > > Best of luck. > > On Mon, Jan 30, 2012 at 11:36 AM, Marcin S <msporysz06-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Hello, Im trying to write a simple app for company internal usage. >> The other applications we use (in php) authenticate users based on >> database credentials, and to be honest I have no idea how to implement >> this. Any suggestions will be great!I know it''s rather bad method, I''ll try to convince them to use more standard approach - i think there is also an LDAP service running, and I saw LDAP plugin for ''AuthLogic'' (or something like that). Anyway i decided to give a shot to this ''bad method'' and this is what i came with (its not pretty). I couldnt use regular establish_connection, bcos it reffering to the application''s main connection with database and after posting bad password/username whole app derails, instead i''m talking to postgresql adapter directly. def authenticate(user,password) begin connection ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.new(nil, nil, ["hostname", 5432, nil, nil, "dbname", user, password], {}) rescue PGError #FAILED redirect_to root_path return end #SUCCES! connection.disconnect! unless connection.nil? redirect_to orders_path end It''s working - but thats all can be said :P I''m not sure if there arn''t some leftovers after such call. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.