pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Łukasz Jarych <jaryszek@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general@postgresql.org >> PG-General Mailing List <pgsql-general@postgresql.org>
Subject: Re: Using DSN Connection and knowing windows username
Date: Wed, 20 Jun 2018 15:11:43 -0700
Message-ID: <ff1d9337-47ca-516d-0db5-e59498b099cb@aklaver.com> (raw)
In-Reply-To: <CAGv31ofhsQ3rGWbfuGD1kmYJUrmYSWThf6jMqHHLZmPHgiL0hw@mail.gmail.com>
References: <CAGv31oegb7cwKb3T5yR5558oG0tcdB8Dd4uPxrotM9tKQmp5Vw@mail.gmail.com>
	<CAKFQuwZFH60pwUP-YseoFx6W=yWtr8sB27mmaLo+mygmeq6+qQ@mail.gmail.com>
	<CAGv31ofhsQ3rGWbfuGD1kmYJUrmYSWThf6jMqHHLZmPHgiL0hw@mail.gmail.com>

On 06/20/2018 07:06 AM, Łukasz Jarych wrote:
> David G,
> 
> thank you.
> Can you confirm if i am thinking correctly ?
> 
> So I can set up authetification to know which user is logged on and use 
> this as postgresql user?

Only if the system user is a postgres user or can be mapped to one:

https://www.postgresql.org/docs/10/static/auth-username-maps.html

> 
> But i think it will be not possible to use DSN connection with this.

If you are talking about the ODBC DSN you use to create the linked table 
in Access then you are correct you are limited to whatever user is 
specified in the ODBC Manager.

It would help to know what you plan to use the user name for?

In the meantime just an idea, but could you capture the system user in a 
table in Access and use that to pass on to Postgres?


> 
> Best ,
> Luke
> 
> 2018-06-20 15:34 GMT+02:00 David G. Johnston <david.g.johnston@gmail.com 
> <mailto:david.g.johnston@gmail.com>>:
> 
>     On Wednesday, June 20, 2018, Łukasz Jarych <jaryszek@gmail.com
>     <mailto:jaryszek@gmail.com>> wrote:
> 
>         How to know in postgresql which specific windows user is using
>         database? 
> 
> 
>     You cannot.  All the server knows is the specific user credentials
>     it is authenticating.
> 
>     That said you can authenticate those credentials in such a way so
>     that knowing the signed on user you would also know who they are in
>     any environment that uses the same authentication source - and if
>     that source supplies their Windows identity you are golden. The
>     specific setups involved here are outside my experience, though.
> 
>     David J.
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (10+ messages)  latest in thread

Message-ID: <ff1d9337-47ca-516d-0db5-e59498b099cb@aklaver.com>
Permalink:  ../ff1d9337-47ca-516d-0db5-e59498b099cb@aklaver.com/
Also on:    postgresql.org/message-id/ff1d9337-47ca-516d-0db5-e59498b099cb@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, jaryszek@gmail.com, david.g.johnston@gmail.com
  Subject: Re: Using DSN Connection and knowing windows username
  In-Reply-To: <ff1d9337-47ca-516d-0db5-e59498b099cb@aklaver.com>
  References: <CAGv31oegb7cwKb3T5yR5558oG0tcdB8Dd4uPxrotM9tKQmp5Vw@mail.gmail.com> <CAKFQuwZFH60pwUP-YseoFx6W=yWtr8sB27mmaLo+mygmeq6+qQ@mail.gmail.com> <CAGv31ofhsQ3rGWbfuGD1kmYJUrmYSWThf6jMqHHLZmPHgiL0hw@mail.gmail.com> <ff1d9337-47ca-516d-0db5-e59498b099cb@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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