Last post Sep 02, 2008 05:33 AM by hello_swe
Aug 04, 2008 12:04 PM|juan.bizoso|LINK
Cookie Path: /
Ticket Expiration: 08/04/2008 12:11:49 PM
IssueDate: 08/04/2008 12:01:49 PM
when you login.
Is there a way for this to be authenticated without a login page using the Computer's Login info wich is the sameone I use in the Login.aspx page?
asp net 2.0
Aug 04, 2008 01:56 PM|jamesqua|LINK
Yes, you can do this with Windows Integrated Authentication instead of Forms Based. Here is a good article explaining the differences and how to do it.
Aug 04, 2008 04:53 PM|juan.bizoso|LINK
Thanks it was very useful and easy. Now that I have been authenticated I need to display all the information of the authenticated user (full name, email, phone, etc.). Is there a way to do this in VB, all the examples I've seen so far are for C# and use
a System.DirectoryServices which I can't seem to import. What I have so far is a simple label that displays the name:
username = User.Identity.Name
What I really need is the telephone because it really has an Id value I will use for a query and not the user's phone number. Thanks again for your time and help.
asp net 2.0
Aug 05, 2008 09:34 AM|juan.bizoso|LINK
What I really need is the Notes field that is in the telephones tab. I looked at a table
http://www.kouti.com/tables/userattributes.htm that says it's LDAP name is "info". I made this routine to pull it out
but keep getting a null ex. Please point me in the right direction.
result = searcher.FindOne()
user = result.GetDirectoryEntry()
Aug 05, 2008 10:04 AM|jamesqua|LINK
Aug 05, 2008 10:12 AM|juan.bizoso|LINK
I don't know I'm really throwing stones here. What I need to get is the Notes from the telephones tab Can you help?
Aug 05, 2008 12:43 PM|jamesqua|LINK
on its own line right before result = searcher.FindOne();
I would also make sure your AD schema has the "info" attribute and that its value is set. You can use the ADSI edit tool to check these attributes.
Also, when you debug, make sure you are getting a result back from your FindOne() method.
Aug 05, 2008 01:29 PM|juan.bizoso|LINK
No the FindOne() method is returning nothing. Also Im not really sure what to put in the searcher.Filter maybe it has to do with that.
Aug 05, 2008 04:23 PM|jamesqua|LINK
I just noticed your DirectoryEntry isn't pointing anywhere. It should be
As New DirectoryEntry("LDAP://DomainName")
where DomainName is replaced with whatever your domain is.
Aug 06, 2008 09:53 AM|juan.bizoso|LINK
Thanks for all your help. I removed the LDAP path so that I could post the code in the forum. What I had wrong was the searcher.Filter("something"), but I found a great article and my app is finally working. I have two last questions. The first is I'm using
this code to get the user thats logged on in the computer:
Will this work when the page is published on the intranet server or will it bring me the server username instead of the user who access the web page from it's desktop?
The other question is I have the connectionstring for LDAP on the web.config, I also added the following elements:
Aug 06, 2008 10:06 AM|jamesqua|LINK
Because you are using integrated security you don't need the membership provder section. You just need to make sure your IIS server settings are correct for integrated. With that the User.Identity will be the loggged in user and not the app pool. I wrote
a post a while back explaining some of this found here.
Aug 06, 2008 10:52 AM|juan.bizoso|LINK
Thank You very much you have been of great help. I learned a lot from your explanations. So, I will eliminate the provider section. And for the last question in my last post what I wanted to know if maybe you know or know an article that explains how to
Aug 06, 2008 01:45 PM|jamesqua|LINK
1. In your project add a reference to the System.Configuration dll
2. Dim entry As New DirectoryEntry(ConfigurationManager.AppSettings("ADConnectionString"))
3. In your web.config add an entry like the following
<add key="ADConnectionString" value="LDAP://YourDomain"/>
Aug 07, 2008 11:36 AM|juan.bizoso|LINK
Thanks for everything I will mark your answer as you have been very helpful. I have now setup a VMServer with Windows Server 2003 to try the website. It works fine, I send the link to my co-workers and the label displayed their respective UserPrincipalNames.
Everything works fine execept when I try to encrypt the connectionstring section using the aspnet_regiis tool in the virtual server. I succesfully encrypt the connString but get this message: Parse Error RSAkey cannot be found. Maybe I'm missing some IIS configurationn
on something else. I don't know if you know about this but I really need to get this first stage completed and security at my job is very important. If I can't get this to work encrypted I'm in trouble!!!! Thanks.
Aug 07, 2008 12:38 PM|jamesqua|LINK
I haven't done a lot of work with that type of encryption, so my advice wouldn't be worth much. I would try posting in the
Sep 02, 2008 05:33 AM|hello_swe|LINK
Can you tell a bit more about how you authenticated with windows?