Skip site navigation (1) Skip section navigation (2)

Re: libpq and auth type

From: Ludek Finstrle <luf(at)pzkagis(dot)cz>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: libpq and auth type
Date: 2006-01-11 16:11:15
Message-ID: 20060111161115.GB28494@soptik.pzkagis.cz (view raw or flat)
Thread:
Lists: pgsql-interfaces
Wed, Jan 11, 2006 at 10:12:33AM -0500, Tom Lane napsal(a):
> Ludek Finstrle <luf(at)pzkagis(dot)cz> writes:
> > When ODBC connect to backend with special parameter it needs to
> > popup dialog (on windows) to enter (unspecified) username, password,
> > etc which is needed by backend to authenticate.
> > But this is againist kerberos (and maybe trust) authentication.
> 
> So?  Why does ODBC care which auth method gets used?  I'm not aware of
> any other client code that has ever needed to know that, and so I'm
> suspicious of your reasoning for ODBC needing to know it.

I don't know if I can describe it better. Please take a look at:
http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/~checkout~/psqlodbc/psqlodbc/drvconn.c?rev=1.45.2.1&content-type=text/plain

Find there "SQL_DRIVER_COMPLETE" (without quote). It ensure if some
required parameters is missing. If the parameter is missing it open
dialog window for user to complete the connect informations.
It's from previous maintainer.

There is the problem that I don't know if the parameter is required
or not (it depends on authentication method: ident, krb, trust doesn't
require uid, pwd; other auth methods does).

If I don't want break this behaviour with krb I need to know what
auth method is used. I don't see another way. Do you?

I snip following from MS ODBC spec - part "Driver Guidelines"
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqldriverconnect.asp):
| Based on the value of DriverCompletion, the driver prompts the user
| for connection information, such as the user ID and password, and
| connects to the data source:
|
| * SQL_DRIVER_PROMPT: The driver displays a dialog box, using the
|     values from the connection string and system information (if any)
|     as initial values. When the user exits the dialog box, the driver
|     connects to the data source. It also constructs a connection
|     string from the value of the DSN or DRIVER keyword in
|     *InConnectionString and the information returned from the dialog
|     box. It places this connection string in the *OutConnectionString
|     buffer.
| * SQL_DRIVER_COMPLETE or SQL_DRIVER_COMPLETE_REQUIRED: If the
|     connection string contains enough information, and that
|     information is correct, the driver connects to the data source
|     and copies *InConnectionString to *OutConnectionString. If any
|     information is missing or incorrect, the driver takes the same
|     actions as it does when DriverCompletion is SQL_DRIVER_PROMPT,
|     except that if DriverCompletion is SQL_DRIVER_COMPLETE_REQUIRED,
|     the driver disables the controls for any information not required
|     to connect to the data source.
| * SQL_DRIVER_NOPROMPT: If the connection string contains enough
|     information, the driver connects to the data source and copies
|     *InConnectionString to *OutConnectionString. Otherwise, the driver
|     returns SQL_ERROR for SQLDriverConnect.

Maybe I don't understand it well (my english isn't good).

Thanks,

Luf

In response to

Responses

pgsql-interfaces by date

Next:From: Tom LaneDate: 2006-01-11 16:21:55
Subject: Re: libpq and auth type
Previous:From: Tom LaneDate: 2006-01-11 15:12:33
Subject: Re: libpq and auth type

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group