identity-customer-data-service
Lightweight, extensible Customer Data Server built to power personalized experiences through unified user profiles and behavior insights.
β‘ Quickstart
β
Prerequisites
π οΈ Configuration Steps
-
Register an M2M Application
- Go to WSO2 Identity Server Console.
- Create a Machine-to-Machine application.
- Under Api Resources section:
- Subscribe to Claim Management APIs.
- Under Protocol section
- Copy the Client ID and Client Secret.
- Select JWT as Access Token type.
- Add "iam-cds" to the Audience.
-
Create an Admin user
- Go to WSO2 Identity Server Console .
- Navigate to User Management section --> Users.
- Create the user. Copy username and password
- Navigate to Console Settings
-
Create the Environment File
-
Create Application that you want to use to access these APIs from
- Register applications you want to integrate with the CDS.
- Subscribe to required APIs from API Resources section:
- Profiles
- Profile Schema
- Unification Rules
- Consent Management
-
Obtain token against the application
- Include required scopes for your use case.
- required_scopes:
-
profile:create: "internal_cdm_profile_create"
-
profile:update: "internal_cdm_profile_update"
-
profile:view: "internal_cdm_profile_view"
-
profile:delete: "internal_cdm_profile_delete"
-
unification_rules:view: "internal_cdm_unification_rule_view"
-
unification_rules:create: "internal_cdm_unification_rule_create"
-
unification_rules:update: "internal_cdm_unification_rule_update"
-
unification_rules:delete: "internal_cdm_unification_rule_delete"
-
profile_schema:view: "internal_cdm_profile_schema_view"
-
profile_schema:create: "internal_cdm_profile_schema_create"
-
profile_schema:update: "internal_cdm_profile_schema_update"
-
profile_schema:delete: "internal_cdm_profile_schema_delete"
π― Include only the scopes you need in your token request.
`curl --location 'https://localhost:9443/oauth2/token' \
--header 'Authorization: Basic <Base64Encoded(CLIENT_ID:CLIENT_SECRET)>' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=internal_cdm_profile_update internal_cdm_profile_delete internal_cdm_profile_view internal_cdm_profile_create '`
- Use the token obtained from token request call in Authorization header when calling CDM APIs.
Authorization: Bearer <access_token>
π Build and Run
π§ Step 1: Start PostgreSQL
docker run -d -p 5432:5432 --name postgres \
-e POSTGRES_USER=cdsuser \
-e POSTGRES_PASSWORD=cdspwd \
-e POSTGRES_DB=cdsdb \
postgres
π Step 2: Initialize the Database
docker exec -i postgres psql -U cdsuser -d cdspwd < dbscripts/postgress.sql
π Step 3: Build the Product
make all
βΆοΈ Step 4: Run the Product
cd target
unzip cds-1.0.0-m1-SNAPSHOT.zip
cd cds-1.0.0-m1-SNAPSHOT
./cds