Configuring API Access for the Web Component
The UNIFYConnect Web Component operates the UNIFYConnect service through an API. By default, the UNIFYConnect Web Component is configured to use the default UNIFYConnect API. If the UNIFYConnect API is reconfigured, the Web Component must also be reconfigured to use it correctly.
Configuration
The following configuration is located in the Web\Web.config file.
Inside the appSettings element in the configuration element, find the following:
<add key="apiAddress" value="{apiAddress}" />
<add key="apiTimeout" value="{apiTimeout}" />Update the {apiAddress} to match that of the desired API, ensuring it is the full URI including protocol, port and path eg: http://localhost:59991/.
Update the {apiTimeout} to the desired API timeout eg: 00:10:00. This timeout should be raised if A task was cancelled error messages ever occur.
Authentication
If the desired API has authentication configured, the following elements must also be configured:
<add key="api:AuthorizeSetting" value="AADBearer" />
<add key="api:Tenant" value="{Tenant}" />
<add key="api:AADInstance" value="https://login.microsoftonline.com/{0}" />
<add key="api:UIServiceResourceId" value="{UIServiceResourceId}" />
<add key="api:UIClientId" value="{UIClientId}" />
<add key="api:UIAppKey" value="{UIAppKey}" />The above five settings should be configured as follows:
| Name | Description |
|---|---|
| Tenant | The tenant setting of the target API. |
| AADInstance | The instance ID of the directory representing the UNIFYConnect API authentication setup. |
| UIServiceResourceId | The audience setting of the target API. |
| UIClientId | The ID of the client application representing the UNIFYConnect API authentication setup. |
| UIAppKey | The secret key from the client application representing the UNIFYConnect API authentication setup. |
HTTPS
An API endpoint can be configured to use HTTPS by performing the following steps:
- Install the certificate to use with HTTPS as a local machine certificate. A user certificate cannot be used.
- Run the following command in an administrator command prompt:
netsh http add sslcert ipport=0.0.0.0:8000 certhash=0000000000003ed9cd0c315bbb6dc1c08da5e6 appid={00112233-4455-6677-8899-AABBCCDDEEFF}
Set ip port to that which the API endpoint is configured to use, the certhash the thumbprint of the desired certificate, and the appid a random GUID for identification purposes. - Update the configuration for the API. If you're modifying the default API, make sure you have a correctly configured web component ready to confirm the API changes.