Solved

Active Directory Authentication by Machine Name

Posted on 2006-11-15
8
741 Views
Last Modified: 2010-02-25
I have developed an Intranet  Web Application using ASP 3.0

There is a section where I can enter my Active Directory Login name & Password
and get authenticated to certain pages.

Now I want to be atumomatically logged in once I open the Intarnent Home Page, since there should some kind of a script that will get my machine Name, and authenticate me based on that my machine is a member of a domain.

0
Comment
Question by:aqunix
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
8 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 17948935
Take out Anoymous access and enable only Integrated Windows Authentication. Then user logged in to your domain would be able to get to you page. You can get their loginid in variable Request.ServerVariables("LOGON_USER"). To enable authentication in IIS follow direction in

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/1aa70bfa-add5-4f61-9c7b-a095c1bd4306.mspx?mfr=true
0
 
LVL 58

Expert Comment

by:amit_g
ID: 17948946
0
 

Author Comment

by:aqunix
ID: 17954194
I know how to enable the Integrated widows Authentication, and I can retrive my PC name.

What I need is:

I want to search for my PC name to the Active directroy and if Exsits and my PC is a member of AC, then I should be authenticated based on the Stored information about my PC in the AC.



0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 58

Expert Comment

by:amit_g
ID: 17963285
PC name or User Name? If UserName, after enabling Integrated widows Authentication and taking off Anonymous Authentication, you are gauranteed that anyone who gets to your page is already authenticated via AD as windows logon would have already tested it. So your application need not do anything. On the other hand if you are looking for both Windows Anthentication and Anonymous authentication togethere, it won't work becuase if Anoynous is enabled, there is no way to know who is logged in via a web application as the browser doesn't pass that information to the web server and so asp can't do anything.
0
 

Author Comment

by:aqunix
ID: 17971007
I could find the solution:

1- I have downloaded a free DNS component [ aspdns ]
2- This tool will return me the logged in machine Name
3- I could retrive the List of Machine from the Active directory , and I stored them in an Array
4- I searched for the Machine Name if there is a Match in the Array
5- if Machine Name was found then I will be logged in , other wise no access.
6- Then get the Machine Information from the AD.

<%
'------------------- Get the Machine Name of the Logged in User ---------------------
Set DNS = Server.CreateObject("ASPDNS.DNSLookup")
A = DNS.GetIPFromName(Request.ServerVariables("REMOTE_ADDR"))
NameA = DNS.GetNameFromIP(A)
Set DNS = Nothing
SplitName = split(NameA,".",-1)
MachineName = SplitName(0)

strUserName              = Ucase(MachineName)

%>


<%
'------------------- Get the Full Machines Name List from the AD ---------------------

on error resume next

Dim strDomain
Dim strADsPath
Dim strUserName
Dim strPassword
Dim iFlags
Dim errorcount

errorcount = 0

strDomain = "Your AD Domain Name"

strADsPath       = strDomain
iFlags             = Request.Form("Flags")


%>

<%
Function getUsers(strDomain)
    Dim oDomain, User, msg

    Set oDomain = GetObject("WinNT://" & strDomain)
    oDomain.Filter = Array("computer")
    For Each User in oDomain
      msg = msg & User.Name & ","
    Next
    getUsers = msg
End Function

'-------------- Build an Array for the AD Machines -------------------------
MachineArray = getUsers(strDomain)
MachineArray = split(MachineArray,",",-1)
x = Ubound(MachineArray)
x=x+1


' ------------------ Search for the logged Machine Name withen the Array ---------------------
i    = 0
Flag = 0

While i<x
 if strUserName = Ucase(MachineArray(i)) then
 Flag =1
 End if
i=i+1
Wend


'---------------- If Not Found [ NO Access ]
if Flag=0 then
url = "noaccess.asp"
response.Redirect(url)
End if

If Flag=1  then

           Session("USER_LOGIN") = strUserName
           Session("isLoggedIn") = True
           Session("ValidUser")  = True
 

Dim User
Set User = GetObject("WinNT://" & strDomain & "/" & strUserName & ",user")
FullName = User.Fullname
End if

Response.write " Welcome :" & FullName

%>
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 18212175
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Time Conversions...both ways 2 29
Hide Table in merge 3 53
add 'N to prepared ASP/VB insert statement 1 36
Classic ASP - Display returned sql output parameter 9 54
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question