|
-
Aug 11th, 2006, 07:41 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2005] windows authentication
ok i've done a search and found somethings here posted by robdog, woka, and mendhak and links to how to get information with the DirectoryServices, but this didn't really help me out. Since i'm not using a form for login it's all based on when the user opens a specific link to this intranet app. this is what i have in my web.config file
Code:
<authentication mode="Windows"/>
<authorization>
<allow users="MyDomain\dklingman, MyDomain\jwagner"/>
<deny users="*"/>
</authorization>
my question is how could i or would i know how is logged in... i mean i realize i know that i'm logged in but in order to pass that information to the DirectoryServices and get the fullname information back?
also i have an admin page that i want to be able to allow the admin to add new users to the config file how can i get my app to add, edit and delete users from the allow users?
-
Aug 11th, 2006, 10:06 AM
#2
Re: [2005] windows authentication
Use User.Identity.Name to get the user name. That is the person who is currently logged in, provided you're using windows authentication.
You can then use that to query active directory as you've seen in the examples.
For Q2, you can't edit the web.config file using the .NET framework's own methods, but you can write your own class that will parse and edit the web.config file (it is after all an XML file)
-
Aug 11th, 2006, 10:30 AM
#3
Thread Starter
Frenzied Member
Re: [2005] windows authentication
excellent mendhak... thank you as always... you're always a life saver
-
Aug 11th, 2006, 10:45 AM
#4
Fanatic Member
Re: [RESOLVED] [2005] windows authentication
Is that User.Identity.Name only for Windows Authentication or also for Forms Authentication?
-
Aug 11th, 2006, 10:46 AM
#5
Thread Starter
Frenzied Member
Re: [RESOLVED] [2005] windows authentication
should be for both??? i think
-
Aug 13th, 2006, 03:48 PM
#6
Re: [RESOLVED] [2005] windows authentication
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|