I have the following in place. Is this sufficient code for windows authentication and AD roles? Is the code in the right event (page_load) or should it be somewhere else?
Right now I get the statement on the top of the screen, you do not have access, and the default page loads. I'm not in the 'aRole'.
Also, can this type of code be tested on the local machine or does it have to be uploaded on a dev or production server?
authentication mode="Windows"
authorization
deny users="?" /> <!--Deny anonymous users -->
allow roles="domain\roleA,domain\roleB"
authorization
identity impersonate="true"
(page_load event)
If User.IsInRole("aRole") Then
Response.Redirect("~\default.aspx")
Else
Response.Write("you do not have access")
End If
Right now I get the statement on the top of the screen, you do not have access, and the default page loads. I'm not in the 'aRole'.
Also, can this type of code be tested on the local machine or does it have to be uploaded on a dev or production server?
authentication mode="Windows"
authorization
deny users="?" /> <!--Deny anonymous users -->
allow roles="domain\roleA,domain\roleB"
authorization
identity impersonate="true"
(page_load event)
If User.IsInRole("aRole") Then
Response.Redirect("~\default.aspx")
Else
Response.Write("you do not have access")
End If