Active Directory Authentication (Full Version)

All Forums >> [Web Development] >> ASP, PHP, and Database



Message


wizard_oz -> Active Directory Authentication (6/8/2009 12:35:33)

Hi, I would like to create an intranet and I would like that the user will log in to th e web with their Active Directory Authentication.
Can anyone help me with that?
Thanks




swoosh -> RE: Active Directory Authentication (6/8/2009 12:55:53)

Wouldn't that be just setting a permission to the folder that the intranet site is contained within?.....or even setting a mapped drive to the folder for the group that has the permissions to the site




wizard_oz -> RE: Active Directory Authentication (6/8/2009 16:01:09)

No, every user have to choose something it's like a vote to something. after the user vote I am taking the vote details and update my database




swoosh -> RE: Active Directory Authentication (6/8/2009 16:20:33)

Another words, you want the voting poll to show up the minute they log in?




wizard_oz -> RE: Active Directory Authentication (6/8/2009 16:39:50)

no i just want every user will choose something from a combo and I'm going to update the database with the username and his choice




swoosh -> RE: Active Directory Authentication (6/8/2009 16:48:14)

Oh, sorry for the confusion on my part. I was misinterpreting your post from the title that you gave it. So you basically want them to have access to a web page with a form of drop downs, check boxes whatever and then have them choose. After choosing, the info gets sent to the database which in turn is automatically updated with count results

Am I getting it?




wizard_oz -> RE: Active Directory Authentication (6/8/2009 16:51:00)

the part of the choosing you are right. I have to knoe who choose what which mean i have to send the user details also to the database




swoosh -> RE: Active Directory Authentication (6/8/2009 16:54:59)

quote:

I have to knoe who choose what which mean i have to send the user details also to the database


Without them putting their name or choosing their name on the voting form .........you want their name to be picked up automatically via the Active Direcotry Authentication?




wizard_oz -> RE: Active Directory Authentication (6/8/2009 17:05:27)

yessssss :-)




clum1 -> RE: Active Directory Authentication (6/9/2009 3:55:03)

In IIS, right click on the site and choose Properties. Click on the Directory Security tab and click Edit. Remove the tick from "Enable Anonymous Access" and add a tick at "Integrated Windows autehntication".

This will cause your server to authenticate all users agains their Windows AD logon accounts; IE will do this automatically (users will see no changes) whilst other browsers will require a logon with their AD credentials.

You can do various things once you have set this up; one useful function allows you to capture the user's login name and use it for (e.g.) security on pages; I use the following function (possibly even supplied by someone here years ago!) to compare login name with a list of know staff on my intranet:

'Function to determine user's NT Username
Function NTUserName()

Dim logon, myArray

'will return Domain\Username or just Username depending
'if the user is logged into the domain or their local machine.
logon = Request.ServerVariables("LOGON_USER")

'so we split the logon variable by the "\"
myArray = Split(logon, "\", -1, 1)

'take the upper bound of the logon variable
logon = myArray(Ubound(myarray))

'and you're left with just the NT Username
NTUserName = lcase(logon)

End Function





wizard_oz -> RE: Active Directory Authentication (6/15/2009 10:01:29)

Hi, thanks it's working on my computer but now the problem is when I install my code at the server so anyone will be able to login it is not working. if I load just simple HTML file it is working. this is my code
<FORM action="UserDB.asp" method=get id=form1 name=form1>
<%
	'will return Domain\Username or just Username depending 
	'if the user is logged into the domain or their local machine. 
	logon = Request.ServerVariables("LOGON_USER") 
	UserName1=Request.ServerVariables("PATH_INFO")
	'so we split the logon variable by the "\" 
	myArray = Split(logon, "\", -1, 1) 

	Set objADSysInfo = CreateObject("ADSystemInfo")
	strUser = objADSysInfo.username

	Set objUser = GetObject("LDAP://" & strUser)
	UserSingleNameCounter=len(objUser.name)-3
	UserSingleName=right(objUser.name,UserSingleNameCounter)
	Response.Write "<br><br>Hello " & right(objUser.name,UserSingleNameCounter)

	'take the upper bound of the logon variable   objUser.name
	logon = myArray(Ubound(myarray)) 

	'and you're left with just the NT Username 
	NTUserName = lcase(logon) 

	'Response.Write "<br><br><br><br>" & NTUserName
	Response.Write "<INPUT type=hidden id=UserSingleName name=UserSingleName value=" & NTUserName & ">"
	Response.Write "<INPUT type=hidden id=NTUserName name=NTUserName value=" & NTUserName & ">"
	%><br><br><br><br>
<INPUT type="submit" value="äîùê" id=submit1 name=submit1>

</FORM>

can anyone please help me....
Thanks, Elen




clum1 -> RE: Active Directory Authentication (6/15/2009 10:27:45)

You are running this on a server in your own Active Directory rather than a web hosting company aren't you? If the latter, it won't work - you'll also need to set the permissions in IIS on the server - you may need to speak to your IT dept for this.




wizard_oz -> RE: Active Directory Authentication (6/15/2009 10:32:16)

yes i am running this on a server in my Active Directory and I set the permissions to everyone full control but still i can't load it




clum1 -> RE: Active Directory Authentication (6/15/2009 10:40:03)

I'm not sure why you'd set "everyone full control"? You are actually restricting "everyone" and only allowing authenticated users:

quote:

In IIS, right click on the site and choose Properties. Click on the Directory Security tab and click Edit. Remove the tick from "Enable Anonymous Access" and add a tick at "Integrated Windows autehntication".


Have you done this in the same way as for your dev PC?




wizard_oz -> RE: Active Directory Authentication (6/15/2009 10:44:48)

no but I removed it from the server and it still doesn't work. I did everything like in my DEV




clum1 -> RE: Active Directory Authentication (6/15/2009 11:01:40)

Probably the best way to tell if you've set it up correctly without worrying about any mistakes in your code is to make the change to the particular site on the server (ie. setting up authentication) and then attempt to access it through FireFox (not Internet Explorer); as you attempt to connect to the site, FF will request your windows username and password; IE does not as it integrates AD authentication.
What happens when you try this?




wizard_oz -> RE: Active Directory Authentication (6/15/2009 11:52:55)

the main problem is with those line
Set objADSysInfo = CreateObject("ADSystemInfo")
strUser = objADSysInfo.username
Set objUser = GetObject("LDAP://" & strUser)
the soulution that i found is not use it and caculate the length of the display name from the Request.ServerVariables("LOGON_USER")




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.09375