dbTalk Databases Forums  

Changing session ownership in a web app (or how to peel an onion)

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss Changing session ownership in a web app (or how to peel an onion) in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Greg Wickham
 
Posts: n/a

Default Changing session ownership in a web app (or how to peel an onion) - 10-15-2004 , 06:39 AM







Hi All,

Earlier this year there was a discussion between Tom and Ezra regarding extending 'set session authorization' to facilitate changing
the identity of a connection. A synopsis of the discussion is that Tom felt this was bad and the web application should have more
responsibility for handling session security.

I need to implement some session based authentication / authorization and would like to learn from others experience before
embarking too far down this path.

Some constraints:

1/ I'm not keen on embedding secret passwords in a web config file but if I have to I will (*sigh*).

2/ The user names used in the authentication credentials (from the perspective of the user) are _NOT_ the same as those internally
used in postgres. (Postgres has strict limitations on usernames which make using them for users impractical.)

3/ I want to use cookies and session based authentication (rather than continually use a username password tuple for each request).
(But then you could rationalize that the username / password could be reversed out of the session key so this may be a mute point -
it will be over a secure connection).

To meet these constraints it would appear necessary to:

1/ Run an external mapping of human usernames to postgres user names (or burn a connect / disconnect cycle to the db).

2/ Connect using the credentials (mapped username) and provided password

3/ Work as necessary (using connected uid)

4/ Disconnect

Is this the best (or only) technique?

If any one has any suggestions or experience in this then I'd appreciate hearing them.

Thanks in advance,

-Greg




---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html


Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: Changing session ownership in a web app (or how to peel an onion) - 10-15-2004 , 12:13 PM






"Greg Wickham" <greg.wickham (AT) grangenet (DOT) net> writes:
Quote:
... (Postgres has strict limitations on usernames which make using
them for users impractical.)
Er, which "strict limitations" would those be? You can put almost
anything into a double-quoted identifier.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
  #3  
Old   
Greg Wickham
 
Posts: n/a

Default Re: Changing session ownership in a web app (or how to peel an onion) - 10-15-2004 , 05:14 PM




Hi Tom,

I didn't know that double quotes around user names permitted much more variety (of user names).

As always - many many thanks.

-Greg

Quote:
-----Original Message-----
From: pgsql-general-owner (AT) postgresql (DOT) org [mailtogsql-general-owner (AT) postgresql (DOT) org] On Behalf Of Tom
Lane
Sent: Saturday, 16 October 2004 3:14 AM
To: Greg Wickham
Cc: pgsql-general (AT) postgresql (DOT) org
Subject: Re: [GENERAL] Changing session ownership in a web app (or how to peel an onion)

"Greg Wickham" <greg.wickham (AT) grangenet (DOT) net> writes:
... (Postgres has strict limitations on usernames which make using
them for users impractical.)

Er, which "strict limitations" would those be? You can put almost
anything into a double-quoted identifier.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.