Changes
/* Comos Login */
[[File:New_Login.png|400px]]
<br>
== Alternative REST Service Configurations ==
By default, the Service URL and RESTAPI_PRE_AUTHENTICATE settings configured directly on the Comos Login are used for communication with the {{COMOS}} REST API.
In some installations, different {{UBIK}} services must access the same {{COMOS}} system through different REST endpoints. For example, an internal service may access {{COMOS}} using an HTTP endpoint, while a Web Service located in a DMZ may need to use an HTTPS endpoint.
<br>
For this purpose, additional CUIServiceConfiguration objects can be configured.
<br>
A CUIServiceConfiguration provides alternative values for the REST service connection while the same Comos Login is still used. The COMOS user, password, project and other login information therefore remain unchanged.
<br>
The following settings can be provided by a CUIServiceConfiguration:
* Service URL
* RESTAPI_PRE_AUTHENTICATE
Each CUIServiceConfiguration must have a name. This name is used in the local service configuration to select the required configuration.
<br>
=== Selecting a CUIServiceConfiguration ===
Selection of a CUIServiceConfiguration is optional and is configured separately for each {{UBIK}} installation.
<br>
To select a configuration, create a file named:
<pre>
UBIK.Interface.CUI.config
</pre>
The file must be located in the local '''Injection''' folder.
<br>
Add the following configuration entry:
<pre>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="ComosRestServiceConfiguration" value="WebService" />
</appSettings>
</configuration>
</pre>
The value of '''ComosRestServiceConfiguration''' must match the name of the CUIServiceConfiguration that should be used.
<br>
In the example above, {{UBIK}} searches for a CUIServiceConfiguration named:
<pre>
WebService
</pre>
If the configuration is found, its Service URL and RESTAPI_PRE_AUTHENTICATE settings are used for communication with the {{COMOS}} REST API.
<br>
=== Default Behaviour ===
The additional configuration is optional.
If no '''UBIK.Interface.CUI.config''' file exists in the local Injection folder, the settings configured directly on the Comos Login are used.
<br>
The same applies if the file exists but no '''ComosRestServiceConfiguration''' setting is configured.
<br>
Therefore, existing installations do not require any changes when only one REST service configuration is needed.
<br>
=== Example ===
The following example shows a setup where two installed {{UBIK}} services use the same Comos Login but access {{COMOS}} through different REST endpoints.
<br>
The Comos Login contains the default configuration:
<pre>
Service URL: http://comos-internal/...
RESTAPI_PRE_AUTHENTICATE: False
</pre>
An additional CUIServiceConfiguration named '''WebService''' contains:
<pre>
Name: WebService
Service URL: https://comos.company.com/...
RESTAPI_PRE_AUTHENTICATE: True
</pre>
An internal {{UBIK}} service without an UBIK.Interface.CUI.config file continues to use the default HTTP configuration.
<br>
For a {{UBIK}} Web Service that must use the HTTPS endpoint, the following UBIK.Interface.CUI.config can be placed in its local Injection folder:
<pre>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="ComosRestServiceConfiguration" value="WebService" />
</appSettings>
</configuration>
</pre>
The Web Service then uses the Service URL and RESTAPI_PRE_AUTHENTICATE settings from the '''WebService''' CUIServiceConfiguration while all other information is still taken from the same Comos Login.
<br>
=== Configuration Overview ===
{| class="wikitable"
! Configuration
! Behaviour
|-
| No UBIK.Interface.CUI.config exists
| The Service URL and RESTAPI_PRE_AUTHENTICATE settings of the Comos Login are used.
|-
| UBIK.Interface.CUI.config exists without ComosRestServiceConfiguration
| The Service URL and RESTAPI_PRE_AUTHENTICATE settings of the Comos Login are used.
|-
| ComosRestServiceConfiguration is configured
| {{UBIK}} searches for a CUIServiceConfiguration with the configured name and uses its REST service settings.
|}
=== Important ===
A CUIServiceConfiguration does not define a different COMOS login.
It only provides alternative REST service connection settings. The COMOS user, password, linked COMOS_PROJECT and other login information continue to come from the original Comos Login.
<br>
This makes it possible to use different network configurations for different {{UBIK}} installations without creating additional Comos Login or Interface Administration objects.
<br>
= Interface Admin Comos =
