You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.

Since CDS 2.1, the customerdata service supports multi-tenant datasources. Enabling multi-tenancy means that calling the API will require sending an additional HTTP header (X-TENANT-ID) with the tenant name. In the configuration of the customerdata service can configure which tenants are allowed to access the API and for each allowed tenant configure a specific datasource.  When the customerdata service is not able to retrieve the tenant name or the given tenant name is not allowed to access a HTTP Status 400 (Bad request) is returned and the details are printed in the log. 

We only support multi-tenancy where each tenant uses the same database vendor. You are not able to mix, for example, an Oracle tenant with an Microsoft SQL Server tenant.

Datasource tenant configuration


blueriq-customerdata-odata-service-v1.yml or blueriq-customerdata-odata-service-v1.properties
blueriq:
  customerdata:
    multi-tenancy:
      enabled: true
      allowed-tenants: <tenant-name-A>,<tenant-name-B>
      tenants: 
        <tenant-name-A>: 
          url: <url>
          username: <username>
          password: <password>
          driver-class-name: <driver>
        <tenant-name-B>: 
          url: <url>
          username: <username>
          password: <password>
          driver-class-name: <driver>


Example setup

Configuration

blueriq-customerdata-odata-service-v1.yml or blueriq-customerdata-odata-service-v1.properties
blueriq:
  customerdata: 
    multi-tenancy:
      enabled: true
      allowed-tenants: google,apple
      tenants: 
        google: 
          url: jdbc:oracle:thin:@localhost:1521:orcl
          username: google
          password: welcome
          driver-class-name: oracle.jdbc.driver.OracleDriver
        apple:
          url: jdbc:oracle:thin:@localhost:1521:orcl
          username: apple
          password: welcome
          driver-class-name: oracle.jdbc.driver.OracleDriver
hibernate:
  dialect: org.hibernate.dialect.Oracle12cDialect
  hbm2ddl:
    auto: validate
  id:
    new_generator_mappings: true
  show_sql: true
  use_nationalized_character_data: true

HTTP request

Example request
GET http://localhost:8080/api/v1/Aggregates HTTP/1.1
Content-Type: application/json
Authorization: Basic Ymx1ZXJpcTp3ZWxjb21l
X-TENANT-ID: google