Progress
Open Client
Developer’s Guide


Asking For Permission In Microsoft Internet Explorer

Asking for permission in Internet Explorer requires that you add specific code to your applet. To add the code, you must:

  1. Down load the security classes for Microsoft by putting the security classes on your CLASSPATH and adding the following import statement to your applet code:
  2. import com.ms.security.*; 
    

    NOTE: The Microsoft security classes are not available as a standalone package. You can get these security classes by downloading the latest Microsoft Java SDK from www.microsoft.com.

  3. Insert the following code into your applet just before creating your Java proxy AppObject:
  4. // Assert Net IO privileges 
    try 
    { 
          if (Class.forName("com.ms.security.PolicyEngine") != null) 
              PolicyEngine.assertPermission(PermissionID.NETIO); 
    }catch(ClassNotFoundException e) 
    { 
          System.out.println("IE Security Manager not found"); 
    } 
    

    This code searches for the class com.ms.security.PolicyEngine. When found, the code calls the static method assertPermission asking for NETIO permission. This method verifies that the user selected yes in the security dialog box when the applet was downloaded. If yes was selected, the user can connect to the AppServer.

    NOTE: With the Microsoft, a user is prompted only once when the code is first downloaded.

    If you use HTTPS, you might also need to obtain file IO privileges from the Microsoft VM security system in order to read the files containing the Root Digital Certificates. If this is the case, add the following line to your code after the line of code that request NETIO privileges:

    PolicyEngine.assertPermission(PermissionID.FILEIO); 
    

    Permissions are only valid for a particular method call and that is why you should insert this code right before you construct your Java proxy AppObject. For instance, if you put this code in its own method, you would no longer have the permission when your method returns. For more information on Microsoft's trust based security model, see the Microsoft SDK for Java documentation.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095