The following java class will output all the values stored in the collections RequestKeys and ContainerServices
The code can be implemented as an External Securit Module, and it will output a list of attribute pairs showing all the elements in the two collections.
The RequestKeys interface is a collection of keys from the request context. Each key is a name-value pair that may have originated from one of several different sources such as the URL query string, form data, cookies, or session variables.
The ContainerServices object implements the ContainerServices interface. This allows portability of the application to specifics of the Web container such as Java Servlets or ASP.NET. The ContainerServices object is a platform-independent class that provides an abstract set of services found in any Web container.
Note: when using third party identity management applications such as Netegrity SiteMinder, or IBM Tivoli that requires the passing of tokens between applications, those tokens will be found in the ContainerServices collection.
The following code can be used to loop through the elements in both collections to verify the header name or variable value being passed to the External Security Module:
package com.Strategy.esm;
import com.Strategy.web.app.AbstractExternalSecurity;
import com.Strategy.web.beans.RequestKeys;
import com.Strategy.web.platform.ContainerServices;
public class Demo1 extends AbstractExternalSecurity {
public int handlesAuthenticationRequest( RequestKeys reqKeys, ContainerServices cntSvcs, int reason) {
System.out.println("------------Request Keys-----------");
for(int i=0;i<reqKeys.getNameCount();i++){
System.out.println(reqKeys.getName(i) + " - " + reqKeys.getValue(reqKeys.getName(i)));
}
System.out.println("");
System.out.println("------------ContainerServices-----------");
for(int i=0; i< cntSvcs.getServerVariables().getNameCount();i++){
System.out.println(cntSvcs.getServerVariables().getName(i) + " - " + cntSvcs.getServerVariables().getStringValue(cntSvcs.getServerVariables().getName(i)));
}
return USE_MSTR_DEFAULT_LOGIN;
}
}PREREQUISITES:
For the sample to work, the Strategy Web JAR files must be accessible by the Java Runtime Environment. The Strategy Web JAR files can be found under:
Note: More elaborate programs will require additional library files and are out of the scope of this document.
ADDITIONAL INFORMATION:
The Strategy SDK allows you to customize the standard Strategy Web interface, and extend and integrate the Strategy business intelligence functionality into other applications. However, before changing the way Strategy Web products look or behave, it is helpful to understand how the application is built. For more information regarding the Strategy Web architecture or the process of customizing Strategy Web, please refer to Strategy Developer Zone (https://resource.microstrategy.com/msdz/).
To access the Strategy Developer Zone, you must have access to the Strategy Knowledge Base, you must have purchased the Strategy SDK, and you must be current on your Strategy maintenance agreement. If you are a US-based business and believe that you satisfy all three of these conditions but you do not have access to the Strategy Developer Zone, please contact Strategy Technical Support at support@microstrategy.com or at (703) 848-8700 . If you are an international business, please contact Strategy Technical Support at the appropriate email address or phone number found at http://www.microstrategy.com/Support/ContactUs.asp.
CUSTOMIZATION WARNING:
This customization is provided as a convenience to Strategy users and is only directly applicable to the version stated. While this code may apply to other releases directly, Strategy Technical Support makes no guarantees that the code provided will apply to any future or previous builds. In the event of a code change in future builds, Strategy Technical Support makes no guarantee that an updated version of this particular customization will be provided. In the event of a code change in future builds, Strategy may not be able to provide additional code on this matter even though this customization is provided at this time for this specific build. For enhancements to this customization or to incorporate similar functionality into other versions, contact your Account Executive to inquire about Strategy Consulting assistance.