PortSight Secure Access Documentation

Configuring Windows Authentication Using the Application Configuration Wizard

 

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.

 

  1. Before you start, you need to create a new ASP.NET application in Visual Studio.NET. Please launch Visual Studio.NET, create a new empty Web application and run it to verify that it works.
  2. Launch Catalog Manager (from the Start -> All Programs -> PortSight Secure Access 2.0 menu). If you still haven't created any catalog, please create a new catalog. The catalog is a database that contains information about users, groups and other settings.

    Secure Access Catalog Manager


  3. Choose the catalog you want to use in your application and click "Configure Your App". The Application Wizard dialog appears and displays all Web applications on your computer registered in IIS. Select your application and click Next.

    Step 1 - Choose Web Application


  4. In the next step, choose the programming language of your application - either Visual Basic.NET or C#.

    Step 2 - Choose Application Language


  5. Now you can choose the type of authentication you want to use. Choose Windows Authentication and click Next.

    Step 3 - Choose Authentication Mode


  6. Now choose steps the wizard should do. It's recommended that you leave all boxes checked unless you really don't want to run particular steps.

    Step 4 - Options


  7. In this step you can check the selected option. Click Finish to complete the Application Configuration Wizard.

    Step 5 - Application Configuration Summary



  8. Wait until the wizard completes the configuration.

    Step 6 - Wizard Is Configuring Your Application


  9. When the wizard finishes, open you project in Visual Studio.NET. If Visual Studio asks you whether to reload project or ignore changes, choose to reload.
  10. 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;								

    What you did:

    You imported PortSight Secure Access namespaces to your code.

  11. Now you can add a welcome message that will display the user name of the current user. Please add a new label control on your Web form and name it Label1. Add the following code in the Page_Load method:

[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.";
}

								

What you did:

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:


Welcome message for authenticated users