IStdSessionLogin Interface

NOTE The IStdSessionLogin interface supersedes the deprecated ISessionLogin interface. Customers should only use the IStdSessionLogin or ISilentSessionLogin interfaces (to maintain session information without presenting a Login dialog to the user) in new development, as well as replace existing implementations of the ISessionLogin interface with IStdSessionLogin or ISilentSessionLogin.

The StdSessionLogin component maintains vital state information required for establishing a login session with FileNet Workplace, such as the Workplace Server URL, user credentials and the login tokens used to authenticate, establish and maintain a "session" with a Workplace Server. This component automatically handles requests for new tokens as they expire, including prompting the user with a Login dialog whenever necessary.

The StdSessionLogin component must be initialized using either InitializeUnifiedLogin or InitializeViaSessionName. The InitializeUnifiedLogin method specifies that the StdSessionLogin component should initialize and share a single login between all FileNet Office Add-Ins. This sharing of a single login is referred to as "unified login". The InitializeViaSessionName method instructs the StdSessionLogin component to create and use its own, separate, non-unified login for the specified client application. Regardless of which method is used, the user will be prompted to provide their username, password, and Workplace Server URL if they are not already logged-in. However, when using a unified login, this will only be required if no other application which shares the unified login is currently logged-in.

The client application must instantiate the StdSessionLogin component and initialize it with the client application name and unique application ID using the IStdSessionLogin interface. However, the client never directly invokes a login or logout operation through the IStdSessionLogin interface. Instead, the client passes the IStdSessionLogin interface pointer to the IAppIntSession::Initialize method of the AppIntSession component, which will cause the login and logout operations to be invoked as they are required during command execution. As a result, when a user initially logs into FileNet Workplace, the user is prompted with a Login dialog to supply Workplace Server URL information (which is automatically persisted for that user), as well as their username and password.

COM Class ID

coclass StdSessionLogin {
[default] interface IStdSessionLogin; interface ISessionLogin;
};

Reference

DLL FnAppIntSessionLogin.dll
See Also ISessionLogin, ISilentSessionLogin and IAppIntSession Interfaces

Methods

The IStdSessionLogin interface defines the following methods:

Method Description
InitializeUnifiedLogin

Initializes the client application's StdSessionLogin component for the login session to FileNet Workplace and instructs the component to share a single, unified login with all other FileNet Office Add-Ins.

InitializeViaSessionName

Initializes the client application's StdSessionLogin component for the login session to FileNet Workplace and instructs the component to create and use its own, separate, non-unified login.

Example 1

The following fragment demonstrates how to initialize the StdSessionLogin component to share a single, unified login between all FileNet Office Add-Ins. For an example of how to initialize the StdSessionLogin component to use its own, separate, non-unified login, see the following example section.

In the application's StdAfx.h header file:

#import"C:\Program Files\FileNet\AppInt\FnAppIntCmd.tlb"                      named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpRequest.dll"              named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntBrowserDlg.dll"               named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpConnection.dll"           named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntResources.dll"                named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientRecordBase.tlb"         named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientStore.dll"              named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSession.dll"                  named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSessionLogin.dll"             named_guids no_namespace

In the application's primary .cpp source file:

// Instantiate the StdSessionLogin component
IStdSessionLoginPtr spIStdSessionLogin;
HRESULT hResult = spIStdSessionLogin.CreateInstance(__uuidof(StdSessionLogin));
if (FAILED(hResult)) { std::cout << "Could not create the StdSessionLogin component." << std::endl; _ASSERTE(0); } try {
// Initialize the StdSessionLogin component to share a single, // unified login between all FileNet Office Add-Ins std::cout << "Initializing the StdSessionLogin component to use unified login..." << std::endl; spIStdSessionLogin->InitializeUnifiedLogin(); ... } catch( ... ) { } ...

Example 2

The following fragment demonstrates how to initialize the StdSessionLogin component to use its own, separate, non-unified login. For an example of how to initialize the StdSessionLogin component to share a single, unified login between all FileNet Office Add-Ins, see the previous example section.

In the application's StdAfx.h header file:

#import"C:\Program Files\FileNet\AppInt\FnAppIntCmd.tlb"                      named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpRequest.dll"              named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntBrowserDlg.dll"               named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpConnection.dll"           named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntResources.dll"                named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientRecordBase.tlb"         named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientStore.dll"              named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSession.dll"                  named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSessionLogin.dll"             named_guids no_namespace

In the application's primary .cpp source file:

// Instantiate the StdSessionLogin component
IStdSessionLoginPtr spIStdSessionLogin;
HRESULT hResult = spIStdSessionLogin.CreateInstance(__uuidof(StdSessionLogin));
if (FAILED(hResult)) { std::cout << "Could not create the StdSessionLogin component." << std::endl; _ASSERTE(0); } try {
// Initialize the StdSessionLogin component to create // a separate, non-unified login for the client application // by specifying the session / client application name. std::cout << "Initializing the StdSessionLogin component to use NON-unified login..." << std::endl; _bstr_t sessionName(_T("WordPerfect")); spIStdSessionLogin->InitializeViaSessionName(sessionName); ... } catch( ... ) { } ...