Installing the .NET Contextual Image Delivery proxy module

To make Contextual Image Delivery work on your .NET Web site containing the API (RESTful) Server Role, install a proxy module that forwards requests to the Contextual Image Delivery microservice.

Procedure

  1. Access your installation media and navigate to the folder Content Delivery\roles\.
  2. Navigate to the folder cid\proxy\dotnet\bin\.
  3. Copy the contents of this folder to the bin\ folder of your .NET web application.
  4. In the root folder of your .NET web application, open Web.config for editing.
  5. Within the system.webServer section, within the modules section, add the following add element:
    <add name="ContextualImageProxyModule" type="Sdl.Web.Context.Image.Proxy.ContextualImageProxyModule" />
  6. In the appSettings section, ensure the presence of the following add elements if you have authentication set up:
    <add key="oauth-client-id" value="USERNAME" />
    <add key="oauth-client-secret" value="PASSWORD" />
    <add key="oauth-enabled" value="true" />

    where USERNAME and PASSWORD are the credentials for accessing the Contextual Image Delivery microservice. You can find valid credentials in the Ambient Data Framework configuration file, cd_ambient_conf.xml, of the Discovery Service. USERNAME must be a user who assumes the cd role; by default, that user is called cduser. Note also that the value of ClientSecret must be an encrypted value.

  7. In the same section, ensure the presence of the following add elements:
    <add key="discovery-service-uri" value="http://DSHOST:DSPORT/discovery.svc/" />
    <add key="cid-service-proxy-pattern" value="PATTERN" />
    where:
    • DSHOST identifies the host server on which the Discovery Service is running
    • DSPORT identifies the port on which the Discovery Service is running (8082 by default)
    • PATTERN specifies a particular URL on which to filter, for example, /cid*. If Contextual Image Delivery should match everything, you can omit the last add element.
  8. If you installed the Contextual Image Delivery microservice properly, the Contextual Image Delivery Capability is registered and can therefore be found through the Discovery Service. If, for some reason, you failed to do so, you can make the service directly discoverable by adding the following add element (not a recommended approach):
    <add key="cid-service-uri" value="http://CIDHOST:CIDPORT/cid" />
    where:
    • CIDHOST identifies the host server on which the Contextual Image Delivery microservice is running
    • CIDPORT identifies the port on which the Contextual Image Delivery microservice is running (8088 by default)
  9. Save and close Web.config.
  10. Restart the web application.