This guide will help you secure your WebForms applications using Secure Access Application Configuration Wizard. It's recommended that you use this wizard since it sets up all settings and copies all files required by Secure Access. Still, if you want to understand what the wizard does or want to add Secure Access support to existing applications, please read the next chapter - Configuring Your Application Manually.
After finishing this guide your application will require authentication using a logon form.
Add the following lines at the beginning of the code-behind of your default page:
[Visual Basic] Imports PortSight.SecureAccess.ARDataServices Imports PortSight.SecureAccess.ARObjects [C#] using PortSight.SecureAccess.ARDataServices; using PortSight.SecureAccess.ARObjects; |
[Visual Basic] Dim userTicket As ARUserTicket userTicket = CType(Session("ARUserTicket"), ARUserTicket) If Not userTicket Is Nothing Then Label1.Text = "Hi " & userTicket.ObjectName & ", welcome to the PortSight Secure Access demo." End If [C#] ARUserTicket userTicket; userTicket = (ARUserTicket) Session["ARUserTicket"]; if (userTicket != null) { Label1.Text = "Hi " + userTicket.ObjectName + ", welcome to the PortSight Secure Access demo."; } |
You added code that takes user ticket stored in the session variable and displays the welcome message.
Compile and run the application. You should see the ACCESS DENIED message. It means that Secure Access cannot find any user with the same user name as you use in your domain. Please log on to the Secure Access user interface for this catalog and create a new user with the same user name you use in your domain, including the domain name - e.g. MYDOMAIN\JOHND. Please make sure that you use a backslash character instead of slash.
Open a new browser and navigate to your sample application. You should see a welcome message now: