Overview:

This document demonstrates how to configure the CSV File Connector application.

Prerequisite:

  • The connector-application binary file is already downloaded and deployed in a specific directory of target system /application directory
  • The Form attributes and their datatype are known to the configurator.
  • TargetSystem service account-specific connection detail  like data source/csv file location, splice ,file access username, password etc
  • Authentication Type
  • There should be a configuration folder present in the same directory where the connector application jar has been deployed/copied

Configuration Directory Structure

/<Deployable Directory>

          /<Deployable Directory>/configurations

                    /<Deployable Directory>/configurations/scim 

                    /<Deployable Directory>/configurations/schemas

Configuration Detail:

Every connector require 2 types of configuration one is scim configuration and schema configuration for a different type of resources.

There is 2 YAML file one for specific to IDHUB connector application and another for splice related configuration.

Resource Configuration:

All resource-specific configuration is kept under directory  /<Deployable Directory>/configurations/schemas . 

There is a file for each type of resource. For example for resource Account, there will be a file Account.json

Each resource file will have a JSON object with the following attribute

id:

id of the resource in a specific format "urn:sath:params:scim:schemas:core:<compatible version number>:<Resource Name>"

name:

Resource name as string i.e Account

description:

Description of the resource as a string

attributes:

An array of JSON Object for different Resource specific attributes of IDHUB system.

Each object will have 3 attributes 

name 

as string

type

as string

required

as boolean

meta

This is a JSON object which has 2 attributes. This doesn't need to change until asked by the Service provider on IDHUB new version release.

resourceType

location

schema

Same as id attribute

matching-attributes

This is a list of attribute names which will be used by splice to determine unique resource in the csv file.

i.e.

"matching-attributes": [
"UserLogin"
]

attribute-map

This is a mapping of the IDHUB Resource attribute with the TargetSystem Resource corresponding attribute.

"attribute-map": {
             "<TargetSystem Attribute Name>": {
                                      "type": "string",
                                      "attribute": "<IDHUB Attribute Name>"
                                        },

......

}

Check the sample below.


configs

This is a JSON object which holds table-specific config for inserting, updating, and searching resource. 

uniqueKey:

This is a unique key attribute in the File to uniquely identify IDHUB user/account


"configs": {
    "uniqueKey":"username",
    }
CODE

The Account Resource sample file for the database connector is given below

{
  "id": "urn:sath:params:scim:schemas:core:1.0:Account",
  "name": "Account",
  "description": "User Account",
  "schemas": "urn:sath:params:scim:schemas:core:1.0:Account",
  "attributes": [
    {
      "name": "email",
      "type": "string",
      "required": true
    },
    {
      "name": "fullName",
      "type": "string",
      "required": false
    },
    {
      "name": "phone",
      "type": "string",
      "required": false
    },
    {
      "name": "UserLogin",
      "type": "string",
      "required": true
    },
    {
      "name":"entitlements",
      "type":"array",
      "required":"false"
    }
  ],
 "meta": {
    "resourceType": "Schema",
    "location": "/v2/Schemas/urn:sath:params:scim:schemas:core:1.0:Account"
  },
  "matching-attributes": [
    "UserLogin"
  ],
  "attribute-map": {
    "fullName": {
      "attribute": "DisplayName",
      "type": "string"
    },
    "phone": {
      "attribute": "PhoneNumber",
      "type": "string"
    },
    "email": {
      "attribute": "email",
      "type": "string"
    },
    "UserLogin": {
      "attribute":"UserLogin",
      "type":"string"
    },
    "entitlements": {
      "attribute": "entitlements",
      "type": "array"
    }
  },
  "configs": {
    "uniqueKey": "UserLogin"
  }
}



JAVA


SCIM Configuration

SCIM configuration is the place to define the scope of what connector can support and some metadata related to the connector. This needs to be updated by the service provider.

The ServiceProfiderConfig.json file looks like this.

{
  "schemas": [
    "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"
  ],
  "documentationUri": "https://www.sath.com/idhub/documentation",
  "patch": {
    "supported": false
  },
  "bulk": {
    "supported": false,
    "maxOperations": 0,
    "maxPayloadSize": 0
  },
  "filter": {
    "supported": false,
    "maxResults": 0
  },
  "changePassword": {
    "supported": false
  },
  "sort": {
    "supported": false
  },
  "etag": {
    "supported": false
  },
  "authenticationSchemes": [
    {
      "name": "OAuth Bearer Token",
      "description": "Authentication scheme using the OAuth Bearer Token Standard",
      "specUri": "http://www.rfc-editor.org/info/rfc6750",
      "documentationUri": "no documentation",
      "type": "oauthbearertoken",
      "primary": true
    },
    {
      "name": "HTTP Basic",
      "description": "Authentication scheme using the HTTP Basic Standard",
      "specUri": "http://www.rfc-editor.org/info/rfc2617",
      "documentationUri": "no documentation",
      "type": "httpbasic"
    }
  ],
  "meta": {
    "location": "scim/v2/ServiceProviderConfig",
    "resourceType": "ServiceProviderConfig",
    "created": "2019-09-03T00:00:00Z",
    "lastModified": "2019-09-03T00:00:00Z",
    "version": "W\/\"3694e05e9dff594\""
  }
}
CODE


Application Configuration:

application.yml

This YAML file has Core Compatibility version, IDHUB services, and security configurations.

info:
  app:
    name: Connector API Application
    description: IDHUB Connector Application
    version: X.X.X
    compatible-core-version: X.X
security:
  oauth2:
    client:
      client-id: IDEShim
      client-secret: <service auth token>
      grant_type: client_credentials
      access-token-uri : https://<IDHUB Base URL>/auth/realms/IDHub/protocol/openid-connect/token
management:
  endpoints:
    web:
      exposure:
        include: info,health,httptrace
idhub-core:
  url: https://<IDHUB Base URL>/api/core
target-system:
  name: <Target Systen/ Application Name>
server:
  port: <Connector Application PORT>
spring:
  security:
    user:
      name: <Service Account/Client ID>
      password: <Service Accpunt Password>
CODE


splice.yml

This YAML file has a target-system specific detail.          

This file has 3 sections

splice

This section holds splice properties like profile, name, environment, and splice version.

target-system

This section holds target-system specific detail like

name:

This is Target System/ application name

username & password 

username and password to login to access the target system data source/CSV file

config-location:

to specify configurations directory

description:

Description of the target system

data

This section holds data source/ csv file related information

location:

The absolute path of the data directory

resources:

This is a JSON object as a string with the attribute as resources and value as the corresponding csv file name.

e.g. '{"account":"users.csv","entitlement":"entitlements.csv"}'

unique-id:

This is type of id to distinguish each entry in the csv file. Keep the default value as uuid


The sample is given below for the CSV file based target system. 

splice:
  profile: splice
  name: file-splice
  environment: test
  version: 1.0.0
target-system:
  name: FlatFile
  username: admin
  password: <encrypted password>
  config-location: /apps/connector-file/configurations
  description: test description
data:
  location: /apps/connector-file/configuration/data
  resources: '{"account":"users.csv","entitlement":"entitlements.csv"}'
  unique-id: uuid



  


CODE