Advertisement

01.09.2008 at 05:19AM PST, ID: 23069269
[x]
Attachment Details

How to retrieve user credentials in .Net?

Asked by davewalter1 in .Net Editors & IDEs, .NET, Microsoft Visual Basic.Net

Tags: VB.Net, Firefox, IE, "No mapping between account names and security IDs was done. (Exception from HRESULT: 0x80070534)"

I posted this question and received a clue here: http://www.experts-exchange.com/Microsoft/Development/.NET/Q_23064765.html

I need to retrieve the credentials of a logged-in user from our LDAP server. The clue I've received is to use System.Net.CredentialCache. Does the browser cache hold the same user information as in that user's LDAP record? Is there a list of attribute names, such as UserName, CountryCode, etc. somewhere that would show me what information is available?  I don't know how to employ this.

The test code that I'm working with is below, and fails with the error: "No mapping between account names and security IDs was done. (Exception from HRESULT: 0x80070534)."  If I can get my test to work, I'm sure I'll be able to use this in the rest of my application, but I'm self-taught and not good enough with ASP.Net to be able to fix this code myself.

Can you help?Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script language="VB" runat="server">
 
    Protected Sub Page_Load(ByVal Src As Object, ByVal E As EventArgs)
        'First Section
        'Get the LDAP path of the current user.
        Dim UserData = Server.CreateObject("AdSystemInfo")
        Dim AUserName As String
        AUserName = UserData.UserName
        aname.Text = AUserName
        'Second section
        'Get the NT 4.0 name of the user.
        Dim WNTData = CreateObject("WinNTSystemInfo")
        Dim BUserName As String
        BUserName = WNTData.UserName
        bname.Text = BUserName
        'Third section
        Dim CUser As String
        CUser = User.Identity.Name
        Cname.Text = CUser
 
    End Sub
 
</script>
</head>
 
<body>
 
<form id="Form1" runat="server">
 
LDAP Path of user:
<asp:label id="aname" Font-Size="10pt" Font-Bold="True" Width="350px" runat="server"/>
<br/>
WinNT Path of User:
<asp:label id="bname" Font-Size="10pt" Font-Bold="True" Width="350px" runat="server"/>
<br/>
User.Identity.Name
<asp:label id="Cname" Font-Size="10pt" Font-Bold="True" Width="350px" runat="server"/>
 
</form>
 
</body>
</html>
[+][-]01.09.2008 at 05:39AM PST, ID: 20617940

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.09.2008 at 05:57AM PST, ID: 20618081

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.10.2008 at 02:53AM PST, ID: 20626204

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.15.2008 at 05:33AM PST, ID: 20662346

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.16.2008 at 03:14AM PST, ID: 20670702

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.16.2008 at 03:24AM PST, ID: 20670751

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.16.2008 at 12:39PM PST, ID: 20675831

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.17.2008 at 01:06AM PST, ID: 20679728

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.17.2008 at 06:49AM PST, ID: 20681776

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.18.2008 at 03:54AM PST, ID: 20689408

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2008 at 06:55AM PST, ID: 20714705

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.22.2008 at 09:28AM PST, ID: 20716172

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.22.2008 at 11:43AM PST, ID: 20717536

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.22.2008 at 12:36PM PST, ID: 20718029

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: .Net Editors & IDEs, .NET, Microsoft Visual Basic.Net
Tags: VB.Net, Firefox, IE, "No mapping between account names and security IDs was done. (Exception from HRESULT: 0x80070534)"
Sign Up Now!
Solution Provided By: PockyMaster
Participating Experts: 1
Solution Grade: A
 
 
[+][-]01.29.2008 at 04:42AM PST, ID: 20767205

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628