Skip to content

Instantly share code, notes, and snippets.

@VictorD

VictorD/txt Secret

Created October 18, 2023 09:16
Show Gist options
  • Save VictorD/e9ddf3c1bdeaf4ae12cf596a3dc03e9b to your computer and use it in GitHub Desktop.
Save VictorD/e9ddf3c1bdeaf4ae12cf596a3dc03e9b to your computer and use it in GitHub Desktop.
experimental group sync attempt
iirc the two changes I did were to add the core:2.0:Group type and simplified the User object from "enterprise" to core
1. around line 25 or so I modified the object mappings:
"objectMappings": [
{
"enabled": true,
"flowTypes": "Add,Update,Delete",
"name": "Provision Azure Active Directory Groups",
"scope": null,
"sourceObjectName": "Group",
"targetObjectName": "urn:ietf:params:scim:schemas:core:2.0:Group",
"attributeMappings": [
{
"defaultValue": null,
"exportMissingReferences": false,
"flowBehavior": "FlowWhenChanged",
"flowType": "Always",
"matchingPriority": 0,
"targetAttributeName": "members",
"source": {
"expression": "[members]",
"name": "members",
"type": "Attribute",
"parameters": []
}
},
{
"defaultValue": null,
"exportMissingReferences": false,
"flowBehavior": "FlowWhenChanged",
"flowType": "Always",
"matchingPriority": 1,
"targetAttributeName": "displayName",
"source": {
"expression": "[displayName]",
"name": "displayName",
"type": "Attribute",
"parameters": []
}
},
{
"defaultValue": "",
"exportMissingReferences": false,
"flowBehavior": "FlowWhenChanged",
"flowType": "Always",
"matchingPriority": 0,
"targetAttributeName": "externalId",
"source": {
"expression": "[objectId]",
"name": "objectId",
"type": "Attribute",
"parameters": []
}
}
],
"metadata": [
{
"key": "IsCustomerDefined",
"value": "false"
},
{
"key": "DisableMonitoringForChanges",
"value": "false"
},
{
"key": "Disposition",
"value": "\"Normal\""
},
{
"key": "ExcludeFromReporting",
"value": "false"
},
{
"key": "EscrowBehavior",
"value": "\"Default\""
},
{
"key": "Unsynchronized",
"value": "false"
},
{
"key": "OriginalJoiningProperty",
"value": "displayName"
}
]
},
{
"enabled": true,
"flowTypes": "Add,Update,Delete",
"name": "Provision Azure Active Directory Users",
"scope": null,
"sourceObjectName": "User",
"targetObjectName": "urn:ietf:params:scim:schemas:core:2.0:User",
"attributeMappings": [
{
"defaultValue": null,
"exportMissingReferences": false,
"flowBehavior": "FlowWhenChanged",
"flowType": "Always",
"matchingPriority": 0,
"targetAttributeName": "active",
"source": {
"expression": "Not([IsSoftDeleted])",
"name": "Not",
"type": "Function",
"parameters": [
{
"key": "source",
"value": {
"expression": "[IsSoftDeleted]",
"name": "IsSoftDeleted",
"type": "Attribute",
"parameters": []
}
}
]
}
},
{
"defaultValue": null,
"exportMissingReferences": false,
"flowBehavior": "FlowWhenChanged",
"flowType": "Always",
"matchingPriority": 1,
"targetAttributeName": "userName",
"source": {
"expression": "[userPrincipalName]",
"name": "userPrincipalName",
"type": "Attribute",
"parameters": []
}
},
{
"defaultValue": "",
"exportMissingReferences": false,
"flowBehavior": "FlowWhenChanged",
"flowType": "Always",
"matchingPriority": 0,
"targetAttributeName": "externalId",
"source": {
"expression": "[objectId]",
"name": "objectId",
"type": "Attribute",
"parameters": []
}
}
],
"metadata": [
{
"key": "IsCustomerDefined",
"value": "false"
},
{
"key": "DisableMonitoringForChanges",
"value": "false"
},
{
"key": "Disposition",
"value": "\"Normal\""
},
{
"key": "ExcludeFromReporting",
"value": "false"
},
{
"key": "EscrowBehavior",
"value": "\"Default\""
},
{
"key": "Unsynchronized",
"value": "false"
},
{
"key": "OriginalJoiningProperty",
"value": "userName"
}
]
}
]
2. at the bottom, around line 2323 I modified "objects" like so:
"objects": [
{
"name": "urn:ietf:params:scim:schemas:core:2.0:Group",
"supportedApis": [
"urn:ietf:params:scim:schemas:core:2.0:Group"
],
"attributes": [
{
"anchor": true,
"caseExact": false,
"defaultValue": null,
"flowNullValues": false,
"multivalued": false,
"mutability": "ReadWrite",
"name": "id",
"required": true,
"type": "String",
"apiExpressions": [],
"metadata": [],
"referencedObjects": []
},
{
"anchor": false,
"caseExact": false,
"defaultValue": null,
"flowNullValues": false,
"multivalued": true,
"mutability": "ReadWrite",
"name": "members",
"required": false,
"type": "Reference",
"apiExpressions": [],
"metadata": [
{
"key": "IsContainer",
"value": "true"
}
],
"referencedObjects": [
{
"referencedObjectName": "urn:ietf:params:scim:schemas:core:2.0:Group",
"referencedProperty": null
},
{
"referencedObjectName": "urn:ietf:params:scim:schemas:core:2.0:User",
"referencedProperty": null
}
]
},
{
"anchor": false,
"caseExact": false,
"defaultValue": null,
"flowNullValues": false,
"multivalued": false,
"mutability": "ReadWrite",
"name": "displayName",
"required": true,
"type": "String",
"apiExpressions": [],
"metadata": [],
"referencedObjects": []
},
{
"anchor": false,
"caseExact": false,
"defaultValue": null,
"flowNullValues": false,
"multivalued": false,
"mutability": "ReadWrite",
"name": "externalId",
"required": true,
"type": "String",
"apiExpressions": [],
"metadata": [],
"referencedObjects": []
}
],
"metadata": [
{
"key": "IsSoftDeletionSupported",
"value": "false"
},
{
"key": "IsHardDeletionSupported",
"value": "true"
},
{
"key": "ConnectorDataStorageRequired",
"value": "true"
},
{
"key": "IsSynchronizeAllSupported",
"value": "false"
}
]
},
{
"name": "urn:ietf:params:scim:schemas:core:2.0:User",
"supportedApis": [
"urn:ietf:params:scim:schemas:core:2.0:User"
],
"attributes": [
{
"anchor": true,
"caseExact": false,
"defaultValue": null,
"flowNullValues": false,
"multivalued": false,
"mutability": "ReadWrite",
"name": "id",
"required": true,
"type": "String",
"apiExpressions": [],
"metadata": [],
"referencedObjects": []
},
{
"anchor": false,
"caseExact": false,
"defaultValue": null,
"flowNullValues": false,
"multivalued": false,
"mutability": "ReadWrite",
"name": "active",
"required": false,
"type": "Boolean",
"apiExpressions": [],
"metadata": [],
"referencedObjects": []
},
{
"anchor": false,
"caseExact": false,
"defaultValue": null,
"flowNullValues": false,
"multivalued": false,
"mutability": "ReadWrite",
"name": "userName",
"required": true,
"type": "String",
"apiExpressions": [],
"metadata": [],
"referencedObjects": []
},
{
"anchor": false,
"caseExact": false,
"defaultValue": null,
"flowNullValues": false,
"multivalued": false,
"mutability": "ReadWrite",
"name": "externalId",
"required": true,
"type": "String",
"apiExpressions": [],
"metadata": [],
"referencedObjects": []
}
],
"metadata": [
{
"key": "IsSoftDeletionSupported",
"value": "false"
},
{
"key": "IsHardDeletionSupported",
"value": "true"
},
{
"key": "ConnectorDataStorageRequired",
"value": "true"
},
{
"key": "IsSynchronizeAllSupported",
"value": "false"
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment