Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# active directory
Hi All,
I am using ADFS ,Active Directory and asp.net based relying party application.
In my active directory structure there are two OU (customer and CustomerSupport). I am creating a user in customer OU through C# code and using UPN field as user logon name. And Creating same UserId from backend in customerSupport OU.
Now I am using below code in my relying party application for retrieving the user from OU’s.
public static string GetADPath(string userType)
        {
            if (_logger.IsDebugEnabled)
                _logger.Debug("ADHelper:Enter GetADPath");
            // Local variables
            string adPath = string.Empty;
            try
            {
                if (userType.Equals(Constants.UserType.Customer))
                    adPath = Utility.GetConfigSetting(Constants.AppSettings.CustomersOUPath);
                else if (userType.Equals(Constants.UserType.CustomerSupport))
                    adPath = Utility.GetConfigSetting(Constants.AppSettings.CustomersSupportOUPath);
                if (_logger.IsDebugEnabled)
                    _logger.Debug("ADHelper:Exit GetADPath");
                return adPath;
            }
            catch (ApplicationException appex)
            {
                if (_logger.IsErrorEnabled)
                    _logger.Error("ADHelper:Exception occurred in GetADPath. Message: ", appex);
                throw appex;
            }
            catch (Exception ex)
            {
                if (_logger.IsErrorEnabled)
                    _logger.Error("ADHelper:Exception occurred in GetADPath. Message: ", ex);
                throw ex;
            }
        }
 
Now my problem is if the same user-Id and password is created on both OU’s. Then CustomerSupport OU user never get login in relying party application its throw rights error.Even I have provided all admin rights in the CustomerSupport OU user’s.
But each time my application check Customer OU’s user (normal user) and user can login other application as normal user.
When I changed the password of CustomerSupport OU user’s then it’s throw “ invalid Id password error”.And user never login in the Relying Party application.
Please any one can suggest how can I handle this situation.
Thanks in Advance.
Posted 24-Mar-12 9:41am
Edited 24-Mar-12 9:44am
(no name)94.3K
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 BillWoodruff 300
1 Mathew Soji 274
2 Afzaal Ahmad Zeeshan 268
3 DamithSL 225
4 Sergey Alexandrovich Kryukov 205
0 OriginalGriff 6,249
1 Sergey Alexandrovich Kryukov 5,853
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 3,865


Advertise | Privacy | Mobile
Web03 | 2.8.1411019.1 | Last Updated 24 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100