4.3.6. Web client


<< Prev   Next >>

4.3.6.1. General information

To run the web client, start the browser and type in an infobase URL. Make sure the browser is set up properly. You can have an infobase opened in several tabs of one web browser at the same time.

4.3.6.2. Language and regional settings

You can select the language of web client interface using one of the following methods (in ascending priority):

  • Preferred language settings in your web browser
  • Command-line parameter L

When you choose an interface language:

  • Locale language is chosen while processing the query to a resource that corresponds to the infobase (for example, http://localhost/demo):
    • If URL contains the L parameter, the value of this parameter is read. For example: http://localhost/demo?l=en to specify English for the localization. If the language is not chosen after reading the parameter, the Accept-Language header is read.
    • If URL does not have any parameters, the standard HTTP header Accept-Language containing information on the preferred languages set in the browser is read.
  • Language is chosen based on the locales available on the server:
    • If an exact match is not found (for example, the option specifies en_US language, which is not available), the language name is truncated and a new search is performed (the search for en).
  • If no matching language is found, the default English (en) language is used.
    • The selected language is added to the base application URL (in the example, the result is http://localhost/demo/en), and the web browser is automatically redirected to this new URL.

Regional settings of a web client session affecting how certain values are displayed (for example, Day and Date) can be specified using the following methods (in ascending priority):

  • Preferred language settings in your web browser
  • Command-line parameter VL

The regional settings of a session are configured in the following way:

  • If the URL contains VL parameter, the regional settings matching the locale code in this parameter are used. For example: http://localhost/demo?vl=en to specify regional session settings for the English language. If the parameter contains an invalid locale code, the web client closes and an error message is displayed.
  • If URL does not have any parameters, the standard HTTP header Accept-Language containing information on the preferred languages set in the browser is read.

4.3.6.3. Authentication with a POST request

In some situations, you may need to run 1C:Enterprise without the standard user authentication window. This option might be necessary if you need to make authentication in 1C:Enterprise using a dedicated form (for example, integrated into a website) or if infobase user credentials are stored in a separate database.

To meet these requirements, you can authenticate a web client session using POST request to infobase resource: e1cib/start. In this case, the startup process follows this procedure:

  1. POST request is made to authenticate the client.
  2. If the authentication is successful, the session is created on behalf of the user specified in the POST request.
  3. Web client is started and the following parameters from the POST request are passed to the web client command line: LowClientConnectionSpeed, LaunchParameter, LocaleCode, and Zone.
  4. Web client connects to the session authenticated in step 2.

The request contains the following parameters:

Usr required

Username.

Pwd optional

User password.

Default value: empty string.

LowClientConnectionSpeed optional

Connection speed.

Values:

  • on. Low connection speed.
  • off. Normal connection speed (default).
LaunchParameter optional

Parameters to be passed to the application. It is similar to the C parameter of the web client command line.

Default value: empty string.

SystemLanguage optional

Interface language. If not set, see article Language and regional settings for details on configuring the interface language and regional settings.

LocaleCode optional

Interface language. If not set, see article Language and regional settings for details on configuring the interface language and regional settings.

Zone optional

Separator values.

AuthFailHandling optional

Determines the system behavior in case of authentication error. Values:

  • error. Returns error code 402 and error message.
  • start. Runs web client with 1C:Enterprise authentication request.
  • redirect. Redirects to URL passed in the AuthFailRedirectURL parameter.

The default value is error.

AuthFailRedirectURL optional

Contains the URL to follow in case of authentication error, if the AuthFailHandling parameter is set to redirect. This URL must be absolute.

Example:

This HTML page illustrates a native authentication form of an infobase located at http://localhost/demoapp.

<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv="Content-Type" content="text/html; charset=utf-8" />
<BODY>
<FORM action="http://localhost/demoapp/e1cib/start" method="post">
User: <INPUT id="usr" name="usr" /><BR />
Password: <INPUT id="pwd" type="password" value="" name="pwd" />
<BR />Low connection speed: <INPUT id="lowclientconnectionspeed" type="checkbox" name="lowclientconnectionspeed" /><BR />
Launch parameter: <INPUT id="launchparameter" name="launchparameter" /><BR />
System language: <SELECT id="systemlanguage" name="systemlanguage">
<OPTION value="ru" selected="">Russian</OPTION>
<OPTION value="en">English</OPTION>
</SELECT><BR />
Session locale code: <SELECT id="localecode" name="localecode">
<OPTION value="ru" selected="">Russian</OPTION>
<OPTION value="en">English</OPTION>
</SELECT><BR />
Data area: <INPUT id="zone" name="zone" />
<INPUT id="authfailhandling" type="hidden" value="error" name="authfailhandling" />
<P><INPUT type="submit" value="OK" /> </P>
</FORM>
</BODY>
</HTML>

The following authentication form is displayed:

Fig. 17. POST request form

<< Prev   Next >>

Icon/Social/001 Icon/Social/006 Icon/Social/005 Icon/Social/004 Icon/Social/002