database - Critique my auth system DB schema? -


I am developing a lush web app that will provide an authentication system for many other applications. Other apps will ask this app via HTTP and bring back the XML of authenticated users.

The authentication app which user is what on the application.

I am working with DB schema. I have my initial design below (assuming that each table has an id column.)

  Applications # Various client applications that will query this auth system. ------------ Name Users # Simplified for table discussion ----- Username Password Email Roles ----- Name application_id Roles - Author ---------- - role_id user_id  

The idea is that someone has tried to do an administrative function in the "Device Inventory" app, so "Device Inventory" will ask the system "Username name and password yyy Get user together. " Then return it (via active resources) through the user object and check if its "code" role with its roles array The "Admin" itself is related to a "code inventory" name with an application object.

Or maybe it would be better to eliminate the applications table and many more roles, for example, " equipment_inventory_admin ", " equipment_inventory_readonly < / Code> "," job_tracker_admin ", etc.

And what is important, simple to normalize the application unit or table structure? Maybe after writing all this I have answered my question, but comments or suggestions will be welcomed.

"post-text" itemprop = "text">

& lt; Login & gt; & Lt; Username & gt; ABC & lt; / Username & lt; Password & gt; Xyz & lt; / Password & gt; 51 & lt; / App & gt; The schema looks intelligent. ; & Lt; / Login & gt;

And you come back

& lt; Auth & gt; & Lt; Users & gt; & Lt; Username & gt; ABC & lt; / A & gt; & Lt; Lastlogin & gt; 123456464 & lt; / Lastlogin & gt; & Lt; / User & gt; & Lt; Applications & gt; & Lt; Name & gt; Device inventory & lt; / Name & gt; & Lt; Version & gt; 3.1.5e & lt; / Edition & gt; & Lt; / Apps & gt; & Lt; Roles & gt; & Lt; Role & gt; Admin & lt; / Role & gt; & Lt; Role & gt; Manager & lt; / Role & gt; & Lt; Role & gt; Dataentry & lt; / Role & gt; & Lt; / Roles & gt; & Lt; / Certification & gt;

or

& lt; Auth & gt; & Lt; Error type = "1" & gt; & Lt; / Auth & gt;


Comments