1

I'm building a site that has two areas: the main site, and an admin area.

The main site has to have Facebook login functionality (I'm looking at using Sammy K's Laravel Facebook SDK) and the admin area is just going to have a database-based login; basically the Laravel login system.

I'm wondering how to approach this, and whether anyone's done this before. Some design considerations:

  1. Should I have two separate user tables?
  2. Should I use two route filters, one for each auth type?
  3. If I only have one user table, should I use different groups (somehow - I'm not sure they'll built in?) or some indicator to let the system know whether it's a database-based, user/password login, or just a Facebook login?
Rob Grant
  • 7,239
  • 4
  • 41
  • 61
  • I had a similar situation, but I was using Zend Framework, so I can't answer your question directly. You might, however, find the information useful: http://stackoverflow.com/questions/4318599/multiple-instances-2-of-zend-auth – Sonny Nov 12 '14 at 19:37
  • @Robert Grant I am experiencing a similar situation and was wondering what did you? Since there is no accepted answer. – lozadaOmr Jan 28 '15 at 06:42
  • @lozadaOmr I didn't to start with :) But eventually ended up working it out for myself, and it turned out basically the same as what itachi said, so I've accepted his answer. You just have two totally different routes, each of which logs the user in in a totally different way. – Rob Grant Mar 31 '15 at 11:45

1 Answers1

2

since you are using facebook SDK,

  • you don't need a user table to begin with in most cases/projects.
  • if you indeed want to use two different authentication, then yes, use one for each auth type.
  • assign different routes for each of the case. don't need to bring all those different entities together and make a sandwich.
itachi
  • 6,323
  • 3
  • 30
  • 40