Re: SSPI auth and mixed case usernames

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: SSPI auth and mixed case usernames
Дата
Msg-id CABUevEzpp+RT9kKRQW+N=O9zrvH4-kvNz1QiOp3fNSL9vPmLBw@mail.gmail.com
обсуждение исходный текст
Ответ на SSPI auth and mixed case usernames  (Niels Jespersen <NJN@dst.dk>)
Список pgsql-general


On Fri, Aug 30, 2019 at 1:27 PM Niels Jespersen <NJN@dst.dk> wrote:
Hello

Postgresql 11.2 on Windows.

I have a user mapping i pg_hba.conf

sspi map=domain

In pg_ident.conf, I have the following:

domain        /^(([A-Z|a-z]{3}[A|a]?)|([Xx]\d{2}))@DOMAIN$    \1

This maps windows logonname til a postgres username. Hower, for reasons I cannot explain, sometimes the username comes in all-lowercase, at other times it comes all-caps. This is dependant on the Windows host the client is connected to.

It is actually dependent on what the user typed into their login box when they logged in to the machine. Yes, that's mostly insane, but that's how those APIs in Windows work.


I do not want to create both XXX and xxx as users on Postgres. I would prefer to translate alle usernames to lowercase in the map.

Is that possible, and if so, how? 

No, PostgreSQL will not do that automatically for you. 

What pg_ident.conf allows you to do is say that the user is allowed to log in to the postgres user in lowercase even if the username retrieved using sspi is not in lowercase. But the application still has to actually try to log in with lowercase, and do so before it connects to PostgreSQL.
 
--

В списке pgsql-general по дате отправления:

Предыдущее
От: Niels Jespersen
Дата:
Сообщение: SSPI auth and mixed case usernames
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: "storing" a calculated value in plsql function ?