473,809 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

4 New Member
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 1917
RhysW
70 New Member
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
2563
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 DC-LogPixelPerInch=1024) Font size is 10, created by CreateFontIndirect(DC, LOGFONT) 1. LOGFONT.LfHeight := 13 ( -(10*96/72) = 13.3333...) 2. LOGFONT.LfHeight := 42 ( -(10*300/72) = 41.666...) 3. LOGFONT.LfHeight := 142 ( -(10*1024/72)...
8
12208
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 place it at the right place. But when I do that several times, only the last position is displayed. How to show all positions ? Thanks Yves
2
1815
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
1087
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: 'searchCriteria_ascx' is ambiguous in the namespace 'ASP'. The register tag on the page shows that both controls have the same tagName but different tagPrefixes. -------------
0
1132
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 in the comboboxes to reflect the revisions availble for that particular part number. Is this possible? Can different DataGridViewCombobox's in the same DataGridviewComboboxcolumn have different items and/ or datasources? If so how is this...
0
1666
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 name="urn:schemas-microsoft-com:office:infopath:PublishedDiagnosticTests:-myXSD-2008-06-13T05-43-58" solutionVersion="1.0.0.75" productVersion="12.0.0.0" PIVersion="1.0.0.0" href="http://sharepointqtc:8558/formservertemplates/PublishedDiagnosticTests.xsn"?> <?mso-application...
0
2223
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 'Invalid argument' exception. Anyone knows why? I'm using windows xp. my source code is here: http://pastebin.com/m23e633a2
0
284
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 migrating a java module to python. In the java code, after creating a socket, the code gets an InputStream and an OutputStream from that socket, sends and receives data in different threads.
1
2810
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"/> </xs:choice> I am not able to do the above and xml beans complains. Any thoughts on how to go about doing it ?
1
1842
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
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.