This topic is locked

Windows Authentication not working

1/22/2009 4:40:51 PM
ASPRunnerPro General questions
S
smcdonald@ciri.com author

I've successfully used the sample code:
if Request.ServerVariables("LOGON_USER")<>"" then

SESSION("UserID") = Request.ServerVariables("LOGON_USER")

SESSION("AccessLevel") = ACCESS_LEVEL_USER

Response.Redirect "xxxx.asp"

end if
and I have set the security to only allow the record to be edited if the user owns that record (it's a user contact list). I can see the "login name" is exactly what my username field is set to, but the list view shows "no records found". My database only holds usernames, not passwords - since I want to use AD, so I've set the security settings to look at a field that is not used or is blank.
the Session("Accesslevel") = user and Session("OwnerID") is blank - if this is helpful
Any suggestions are appreciated.

Thank you,

Sergey Kornilov admin 1/22/2009

ScottM,
you also need to assign a corresponding OwnerID for each table in question.

if Request.ServerVariables("LOGON_USER")<>"" then

SESSION("UserID") = Request.ServerVariables("LOGONUSER")

SESSION("
tablename_OwnerID") = Request.ServerVariables("LOGON_USER")

SESSION("AccessLevel") = ACCESS_LEVEL_USER

Response.Redirect "xxxx.asp"

end if

S
smcdonald@ciri.com author 1/23/2009

As suggested, I added the following line:
SESSION("_EContactData_OwnerID") = Request.ServerVariables("LOGON_USER")
Same result: "No Records Found"
It doesn't seem to be populating the OwnerID variable, although the $username variable is the correct login and there is a cooresponding username in my table.
I assume my 'tablename' is correct? How do I determine the exact name of the "tablename" variable?

Sergey Kornilov admin 1/23/2009

Tablename is the name of your table in the database.
I recommend to test all security modes first and then turn on autologin feature.