ContextIdentifier Casing

Hi everyone!

Recent issues have revealed an inconsisent handing of context identifiers, or customer IDs in the online environment. 

Context identifier come from various places in our APIs:

1) Authentication
- Reference token string: "8A:Cust12345.abc123..."
- id_token claim: http://schemes.superoffice.net/identity/ctx

2) Tenent Status URL
- ContextIdentifier
- Endpoint URL
- Api URL

https://online.superoffice.com/api/state/cust12345
{
"ContextIdentifier": "Cust12345",
"Endpoint": "https://online2.superoffice.com/Cust12345",
"State": "Running",
"IsRunning": true,
"ValidUntil": "2021-06-15T10:17:38.3522606Z",
"Api": "https://online2.superoffice.com/Cust12345/api"
}

3) Connector APIs
- MessageHeader

4) RESTful OData queries

{
  "odata.metadata": "https://sod.superoffice.com:443/Cust12345/api/v1/Archive//$metadata", "odata.nextLink": null,
  "value": [ { "PrimaryKey": "1", "EntityName": "contact", "name": "CompanyName", "nameDepartment": "Company Dept" },
...
}

5) Webhooks

UserAgent: NetServer-Webhook/8.2.123.456X-SuperOffice-Signature: abcXyz123==X-SuperOffice-Event: contact.changedX-SuperOffice-EventId: 88f91933-edce-4c1a-8ded-ade8e2f72434{
  "EventId":"88f91933-edce-4c1a-8ded-ade8e2f72434",
  "Timestamp":"2018-04-05T08:28:01.5732501Z",
  "Changes":["contact_id","updated_associate_id","soundEx","updated","name"],
  "Event":"contact.changed",
  "PrimaryKey":18,
  "Entity":"contact",
  "ContextIdentifier":"Cust12345",
  "ChangedByAssociateId":5,
  "WebhookName":"Tonys Contact Handler"
}

Possibly other places, but these are the ones I can identifiy of the top of my head.

While we would like to provide a consistent casing strategy, it's not the reality today. Therefore the following casings can be observed:

cust12345
Cust12345
CUST12345

Knowing this, the only good comparision strategy to use a case-insensitive strategy. Alternatively your code should have it's own convertion strategy regardless what is received, and compare that to what and how you store it.

We apologize for any inconvenience this has caused.

Noch keine Antworten!