PostgreSQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesPostgreSQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 6th, 2013, 08:38 AM
branquim branquim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 branquim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 11 sec
Reputation Power: 0
Postgres + Ldap username mapping

Hi all,

I've been running in a quest that is driving me crazy.

The situation is:
1 - I have an LDAP user database with usernames composed by just numbers ex.: 82782355812
2 - I need my Postgres users to authenticate with this LDAP database
3 - I have a restriction that my Postgres users must have usernames starting with an alphabetical character, like a82782355812

I tried using pg_ident.conf to map the system user 82782355812 to a82782355812 with no success.

Here is my pg_hba.conf:

host all all 10.10.10.0/24 ldap "ldap://127.0.0.1/basedn;uid=;,cn=users,ou=ldapconfig,dc=mydomain,dc=com"
host all 82782355812 10.10.10.0/24 ident map=test

Here is my pg_ident.conf

test 82782355812 a82782355812

When my configuration is like this one above I get this on postgres log:

2013-02-06 12:22:42 BRST FATAL: role "82782355812" does not exist

When I invert those lines in pg_hba.conf I get this on postgres log:

2013-02-06 12:25:40 BRST FATAL: Ident authentication failed for user "82782355812"

If I have a normal user on LDAP (with an alpha char first in the username), and create the same role on postgres, I can authenticate with success. That implies postgres is authenticating well with LDAP.

The only thing is that my little restriction of having an user base of numbers as usernames needing to authenticate in postgres whit an alpha char prefix in the roles.

It could be that I can achieve this result with other methods than pg_ident.conf, but I'm not realizing which one...

I thought about a regex in the ldap connection string in pg_hba.conf, and custom pam modules with no result.

Do you think it is possible to achieve this result?

Thanks in advance
Alexandre

Reply With Quote
  #2  
Old February 8th, 2013, 05:20 AM
branquim branquim is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 2 branquim User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 11 sec
Reputation Power: 0
Anyone have a clue?

Reply With Quote
  #3  
Old March 7th, 2013, 08:13 AM
fkoenen fkoenen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 1 fkoenen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 55 sec
Reputation Power: 0
You might provide some details on your config/settings of the LDAP layer. I suspect your problem could be resolved by providing an attribute in the DN record that provides the mapping to usernames that begin with a alpha character, or to augment (or strip off) the numeric value with the "a" during bind connect.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesPostgreSQL Help > Postgres + Ldap username mapping

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap