Extend LDAP Membership to append a prefix/sufix to the username

Posted by Romias on Stack Overflow See other posts from Stack Overflow or by Romias
Published on 2009-01-29T13:32:04Z Indexed on 2010/03/23 23:03 UTC
Read the original article Hit count: 367

Our web applications are using LDAP Membership Provider to authenticate and register users in Active Directory. In order to allow users to provide usernames that exist in other applications, we need to add a prefix in its username and it should be as transparent and painless as possible.

What I need is a way to extend the LDAP Membership Provider to be able to add (concatenate) a prefix to the username just before Membership authenticate or register it. For example, if user input is "JohnS" in application 1... I want to authenticate: "App1_JohnS".

How could I extend the membership to accomplish this? Any idea what is triggered just before authenticate and register (create user)?

Update: Each web app has an "OU" in AD where create users to and authenticate from. But as it is just ONE Active Directory Controller the usernames must be unique. We need to solve this issue using Membership providers and not adding more ADs.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about membership