Consider the following scenario. Your application accesses an application server and the following are true:

  • The same application server contains application components for download and business logic for your application.
  • The application detects that the security cache does not contain authentication information.
    Note: These conditions occur when WebClient has not yet downloaded any as-needed application components from the application server.

To access the application server in this situation, your application can prompt the end user for security items by displaying the security dialogs that the WebClient uses. This provides the end user with a consistent interface.

These routines reside, as compiled .r files, in the WebClient installation at OpenEdge-Install-Directory\wcadd. If the CODEBASE-LOCATOR handle contains only some of the required values, these values can be passed into these routines as default values, allowing the user to fill in the remaining values.

When using the authentication dialogs, consider the following:

  • To make the dialogs look exactly the same as when WebClient invokes them, obtain the prompt input parameter from CODEBASE-LOCATOR:END-USER-PROMPT.
  • Before calling an authentication dialog, the application is responsible for obtaining the relevant attribute values from the CODEBASE-LOCATOR handle to pass to these routines. For example, the value of NOT PERSISTENT-CACHE-DISABLED should be passed for the second parameter, enable-persistent-checkbox.
  • After calling an authentication dialog, the application is responsible for setting the appropriate CODEBASE-LOCATOR attributes with the information obtained from the end user.

Displaying the adapter authentication dialog

To display WebClient's adapter authentication dialog, use the _getAIAAuthentication.p procedure, which has the following signature:
DEFINE INPUT        PARAMETER prompt                     AS CHARACTER.
DEFINE INPUT        PARAMETER enable-persistent-checkbox AS LOGICAL.
DEFINE INPUT-OUTPUT PARAMETER url-userid                 AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER url-password               AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER persistent                 AS LOGICAL.
DEFINE OUTPUT       PARAMETER choseOK                    AS LOGICAL.

Use this procedure if the codebase and business logic share authentication information and there is no authentication at the application server itself.

To invoke the _getAIAAuthentication.p procedure, call it with a partially qualified pathname that starts with the wcadd directory, as in the following code fragment:
RUN wcadd/_getAIAAuthentication.p (parameter-list).

Displaying the application server authentication dialog

To display WebClient's application server authentication dialog, use the _getAppServerAuthentication.p procedure, which has the following signature:
DEFINE INPUT        PARAMETER prompt                     AS CHARACTER.
DEFINE INPUT        PARAMETER enable-persistent-checkbox AS LOGICAL.
DEFINE INPUT-OUTPUT PARAMETER appserver_userid           AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER appserver_password         AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER appserver_info             AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER persistent                 AS LOGICAL.
DEFINE OUTPUT       PARAMETER choseOK                    AS LOGICAL.

Use the _getAppServerAuthentication.p procedure if the codebase and business logic reside on the same application server, or if they share the same authorization information and authentication is required:

  • Only on the application server and not on the adapter Web server (or you are not using the adapter)
  • At the adapter and at the application server, but the adapter authorization information is set in the security cache and thus available in CODEBASE-LOCATOR:URL-USERID and CODEBASE-LOCATOR:URL-PASSWORD
    Note: In this case, you might instead call _getAIAandAppServerAuthentication.p, passing in the known values and allowing the end user to fill in the missing values.
To invoke the _getAppServerAuthentication.p procedure, call it with a partially qualified pathname that starts with the wcadd directory, as in the following code fragment:
RUN wcadd/_getAppServerAuthentication.p (parameter-list).

Displaying the adapter and application server authentication dialog

To display WebClient's adapter and application server authentication dialog, use the _getAIAandAppServerAuthentication.p procedure, which has the following signature:
DEFINE INPUT        PARAMETER prompt                     AS CHARACTER.
DEFINE INPUT        PARAMETER enable-persistent-checkbox AS LOGICAL.
DEFINE INPUT-OUTPUT PARAMETER url-userid                 AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER url-password               AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER appserver_userid           AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER appserver_password         AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER appserver_info             AS CHARACTER.
DEFINE INPUT-OUTPUT PARAMETER persistent                 AS LOGICAL.
DEFINE OUTPUT       PARAMETER choseOK                    AS LOGICAL.

Use the _getAIAandAppServerAuthentication.p procedure if the codebase and the business logic share authorization information, you are using the adapter, and authorization is required by the adapter server and by the application server.

To invoke the _getAIAandAppServerAuthentication.p procedure, call it with a partially qualified pathname that starts with the wcadd directory, as in the following code snippit:
RUN wcadd/_getAIAandAppServerAuthentication.p (parameter-list).