pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Store database users in custom table
2+ messages / 2 participants
[nested] [flat]

* Store database users in custom table
@ 2010-03-19 23:19 Antoine POPINEAU <apognu@akegroup.org>
  2010-03-22 18:09 ` Re: Store database users in custom table Scott Mead <scott.lists@enterprisedb.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Antoine POPINEAU @ 2010-03-19 23:19 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I am developping a Java application, and using a PostgreSQL backend 
database. Theorically, there might be lots of users, each with 
potentially different permissions over the different tables.

I could add those user to the database with a classic CREATE USER, but 
that doesn't seem efficient to me, since I've already got a custom table 
with users data and, amongst others, password.

So my question is simple (the answer might not be, though): is there a 
possibility to tell Postgres to fetch user logins and passwords in a 
custom table (perhaps respecting a certain schema) instead of the 
default location?

Thank you.

Antoine POPINEAU.

Attachments:

apognu.vcf (text/x-vcard, 253B) download begin:vcard fn:Antoine POPINEAU n:POPINEAU;Antoine org:Antoine POPINEAU adr:;;24 rue du Berry;Chevilly-Larue;;94550;France email;internet:apognu@akegroup.org tel;cell:+33 6 84 83 01 34 x-mozilla-html:FALSE url:http://www.apognu.net version:2.1 end:vcard
smime.p7s (application/pkcs7-signature, 2.6K) download ^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: Store database users in custom table
  2010-03-19 23:19 Store database users in custom table Antoine POPINEAU <apognu@akegroup.org>
@ 2010-03-22 18:09 ` Scott Mead <scott.lists@enterprisedb.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Scott Mead @ 2010-03-22 18:09 UTC (permalink / raw)
  To: Antoine POPINEAU <apognu@akegroup.org>; +Cc: pgsql-admin

2010/3/19 Antoine POPINEAU <apognu@akegroup.org>

> Hi,
>
> I am developping a Java application, and using a PostgreSQL backend
> database. Theorically, there might be lots of users, each with potentially
> different permissions over the different tables.
>
> I could add those user to the database with a classic CREATE USER, but that
> doesn't seem efficient to me, since I've already got a custom table with
> users data and, amongst others, password.
>
> So my question is simple (the answer might not be, though): is there a
> possibility to tell Postgres to fetch user logins and passwords in a custom
> table (perhaps respecting a certain schema) instead of the default location?
>

There isn't, but the question to ask yourself is:

 Do you want application level users to be able to login to the database
directly???

 If the answer is yes, then you may want to use a centralized authentication
mechanism like LDAP. (postgres can use LDAP authentication).


  If the answer is no, then build your own auth scheme in the application
and have the application login to the database as a specific user ... i.e.

user bob.foo logins to web interface
provides password: login123

  java app says:  Connect to database,
 user: app_read
 pass: %32sd$s2

   Java app says, select user_id, password from users where user_name =
'bob.foo'
    java app runs:
 if result.password = user_entered_password
    then
        login allowed
    else
         denied
    end if

  Obviously, you'd want to use a hash of the password to avoid sending it
over the wire, but I think you get the idea.


--Scott M



 --Scott M

>
> Thank you.
>
> Antoine POPINEAU.
>

^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2010-03-22 18:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-03-19 23:19 Store database users in custom table Antoine POPINEAU <apognu@akegroup.org>
2010-03-22 18:09 ` Scott Mead <scott.lists@enterprisedb.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox