473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How can i differentiate the userid if same userid is available in two different OU wi

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.
Expand|Select|Wrap|Line Numbers
  1. public static string GetADPath(string userType)
  2.         {
  3.             if (_logger.IsDebugEnabled)
  4.                 _logger.Debug("ADHelper:Enter GetADPath");
  5.             // Local variables
  6.             string adPath = string.Empty;
  7.             try
  8.             {
  9.                 if (userType.Equals(Constants.UserType.Customer))
  10.                     adPath = Utility.GetConfigSetting(Constants.AppSettings.CustomersOUPath);
  11.                 else if (userType.Equals(Constants.UserType.CustomerSupport))
  12.                     adPath = Utility.GetConfigSetting(Constants.AppSettings.CustomersSupportOUPath);
  13.                 if (_logger.IsDebugEnabled)
  14.                     _logger.Debug("ADHelper:Exit GetADPath");
  15.                 return adPath;
  16.             }
  17.             catch (ApplicationException appex)
  18.             {
  19.                 if (_logger.IsErrorEnabled)
  20.                     _logger.Error("ADHelper:Exception occurred in GetADPath. Message: ", appex);
  21.                 throw appex;
  22.             }
  23.             catch (Exception ex)
  24.             {
  25.                 if (_logger.IsErrorEnabled)
  26.                     _logger.Error("ADHelper:Exception occurred in GetADPath. Message: ", ex);
  27.                 throw ex;
  28.             }
  29.         }
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.
Mar 24 '12 #1
1 1903
RhysW
70
the simplest solution would be to never let there be a creation of the same username! a solution taken by just about any login script i know of!
Failing that i would hazard a guess that it is always selecting the first instance of the sent username and password which is where your problem is lying as this one doesn't have the correct rights, i'm not extremely familiar with the problem you are facing but i really would suggest restricting there to being one instance only of each username and password

I mean lets look at it as if it were a human not a database if i told you to fetch me someone called jeff where the password is password and there were two instances of this with absolutely no way of differentiating which was which then you would just throw back the first one you find, from your point of view you provided me with what i wanted why should you bother looking again incase there is another instance? so you either need a way to tell them apart or you should never let there be two of them in the first place! i mean say you make a mistake and release the code allowing two usernames to be identical, with different rights and a normal user is for some reason then allowed to log in as the admin user because they share the same fields bit of a security risk there
Apr 13 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Pimpirev | last post by:
Hi all. In windows. Is it possible to show text with the very same appearance in different DC (for example 1. screan DC-LogPixelPerInch=96 ; 2. printer DC-LogPixelPerInch=300 ; 3. . printer...
8
by: Yves PEYSSON | last post by:
Hi, I want to display the same image (from the same file) at different positions in a window. Up to now I used DIV command in the body part of the text, and document.getElementById in order to...
2
by: A.M | last post by:
Hi, I am using WebForms authentication. What would be the best way to prevent two person login with same userID at the same time? Thanks, Alan
0
by: Don | last post by:
I have 2 web user controls (.ascx) with the same name that are in in different namespaces. When I try to put both controls on the same page I get the following runtime error: BC30560:...
0
by: RN | last post by:
All, I have a datagridview control displaying two columns(part number and revision). Both columns are read only. the revision colum is a datagridviewcombobox colum. I would like for the items...
0
by: Anni | last post by:
Hi, Can anyone please tell me how do I give same namespace for different infopath forms.? I have an XML formed by an infopath form, the XML is : <?mso-infoPathSolution...
0
by: Leo Jay | last post by:
I'd like to read and write the same socket in different threads. one thread is only used to read from the socket, and the other is only used to write to the socket. But I always get a 10022...
0
by: Leo Jay | last post by:
On Sat, Aug 23, 2008 at 1:58 AM, Jean-Paul Calderone <exarkun@divmod.comwrote: not exactly. the socket connecting to port 1 is listening to port 2. port 1 and port 2 are not the same. I'm...
1
by: adilfulara | last post by:
Hi i would like to define 2 xml elements with same name but different types in a choice tag <xs:choice> <xs:element name = "B" type="TypeB1"/> <xs:element name = "B" type="TyoeB2"/>...
1
by: Aj Singh | last post by:
I have mulitple websites using the same code but different web.config files. Is there a way where I can achieve not having multiple copies of the same code? so its easy to mantain? Thanks
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.