En fonction de votre situation il faudra adapter le host et port de votre instance CORE, pour moi <CoreServer> = http://192.168.91.1:28080.
Ajout de l'action de propagation:
curl --location 'http://<CoreServer>/syncope/rest/implementations/PROPAGATION_ACTIONS/Person2UserPropagationActions' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "key": "Person2UserPropagationActions", "engine": "JAVA", "type": "PROPAGATION_ACTIONS", "body": "org.apache.syncope.core.Person2UserPropagationActions"}'Ajout des attributs de schéma, classe et objet:
curl --location 'http://<CoreServer>/syncope/rest/schemas/PLAIN' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "_class": "org.apache.syncope.common.lib.to.PlainSchemaTO", "key": "personId", "anyTypeClass": "personne", "type": "String", "mandatoryCondition": "true", "uniqueConstraint": "true" }'curl --location 'http://<CoreServer>/syncope/rest/schemas/PLAIN' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "_class": "org.apache.syncope.common.lib.to.PlainSchemaTO", "key": "nom", "anyTypeClass": "personne", "type": "String" }'curl --location 'http://<CoreServer>/syncope/rest/schemas/PLAIN' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "_class": "org.apache.syncope.common.lib.to.PlainSchemaTO", "key": "prenom", "anyTypeClass": "personne", "type": "String" }'curl --location 'http://<CoreServer>/syncope/rest/schemas/PLAIN' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "_class": "org.apache.syncope.common.lib.to.PlainSchemaTO", "key": "personName", "type": "String"}'curl --location --request PUT 'http://<CoreServer>/syncope/rest/anyTypeClasses/BaseUser' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "key": "BaseUser", "plainSchemas": [ "email", "personName" ], "inUseByTypes": [ "USER" ]}'curl --location 'http://<CoreServer>/syncope/rest/schemas/PLAIN' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "_class": "org.apache.syncope.common.lib.to.PlainSchemaTO", "key": "operationalUnit", "anyTypeClass": "personne", "type": "String" }'curl --location 'http://<CoreServer>/syncope/rest/anyTypeClasses' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "key": "personne", "plainSchemas": [ "personId", "nom", "prenom", "operationalUnit" ], "derSchemas": [], "inUseByTypes": [ "PERSON" ] }'curl --location 'http://<CoreServer>/syncope/rest/anyTypes' \--header 'Accept: application/json' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "key": "PERSON", "kind": "ANY_OBJECT", "classes": [ "personne" ] }'La création du connecteur:
curl --location 'http://<CoreServer>/syncope/rest/connectors' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "errored": false, "adminRealm": "/", "location": "file:/opt/syncope/bundles/", "connectorName": "net.tirasa.connid.bundles.rest.RESTConnector", "bundleName": "net.tirasa.connid.bundles.rest", "version": "1.1.1", "conf": [ { "schema": { "name": "baseAddress", "displayName": "Base Address", "helpMessage": "Base address of the target RESTful service", "type": "java.lang.String", "required": true, "order": -3, "confidential": false, "defaultValues": [] }, "values": [ "http://persons:48080" ], "overridable": false }, { "schema": { "name": "accept", "displayName": "Accept", "helpMessage": "Value for the HTTP Accept header; defaults to application/json", "type": "java.lang.String", "required": true, "order": -2, "confidential": false, "defaultValues": [ "application/json" ] }, "values": [ "application/json" ], "overridable": false }, { "schema": { "name": "contentType", "displayName": "Content-Type", "helpMessage": "Value for the HTTP Content-Type header; defaults to application/json", "type": "java.lang.String", "required": true, "order": -1, "confidential": false, "defaultValues": [ "application/json" ] }, "values": [ "application/json" ], "overridable": false }, { "schema": { "name": "scriptingLanguage", "displayName": "scriptingLanguage", "helpMessage": "scriptingLanguage", "type": "java.lang.String", "required": false, "order": 0, "confidential": false, "defaultValues": [ "GROOVY" ] }, "values": [ "GROOVY" ], "overridable": false }, { "schema": { "name": "searchScriptFileName", "displayName": "searchScriptFileName", "helpMessage": "searchScriptFileName", "type": "java.lang.String", "required": false, "order": 13, "confidential": false, "defaultValues": [] }, "values": [ "/opt/syncope/conf/SearchScript.groovy" ], "overridable": false }, { "schema": { "name": "schemaScriptFileName", "displayName": "schemaScriptFileName", "helpMessage": "schemaScriptFileName", "type": "java.lang.String", "required": false, "order": 17, "confidential": false, "defaultValues": [] }, "values": [ "/opt/syncope/conf/SchemaScript.groovy" ], "overridable": false }, { "schema": { "name": "testScriptFileName", "displayName": "testScriptFileName", "helpMessage": "testScriptFileName", "type": "java.lang.String", "required": false, "order": 18, "confidential": false, "defaultValues": [] }, "values": [ "/opt/syncope/conf/TestScript.groovy" ], "overridable": false }, { "schema": { "name": "updateScriptFileName", "displayName": "updateScriptFileName", "helpMessage": "updateScriptFileName", "type": "java.lang.String", "required": false, "order": 19, "confidential": false, "defaultValues": [] }, "values": [ "/opt/syncope/conf/UpdateScript.groovy" ], "overridable": false }, { "schema": { "name": "syncScriptFileName", "displayName": "syncScriptFileName", "helpMessage": "syncScriptFileName", "type": "java.lang.String", "required": false, "order": 20, "confidential": false, "defaultValues": [] }, "values": [ "/opt/syncope/conf/SyncScript.groovy" ], "overridable": false } ], "capabilities": [ "SEARCH","SYNC","UPDATE" ], "displayName": "RestPerson2", "connRequestTimeout": 10, "poolConf": null }'La création de la ressource, il faudra récupérer au préalable l'identifiant unique du connecteur (faire un GET sur l'api connctors):
curl --location 'http://<CoreServer>/syncope/rest/resources' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "key": "person", "connector": "<IdentifiantConnecteur>", "connectorDisplayName": "RestPerson", "provisions": [ { "anyType": "PERSON", "objectClass": "__PERSON__", "ignoreCaseMatch": false, "mapping": { "items": [ { "intAttrName": "name", "extAttrName": "personId", "connObjectKey": true, "password": false, "mandatoryCondition": "true", "purpose": "PULL", "propagationJEXLTransformer": null, "pullJEXLTransformer": null, "transformers": [] }, { "intAttrName": "personId", "extAttrName": "personId", "connObjectKey": false, "password": false, "mandatoryCondition": "true", "purpose": "PULL", "propagationJEXLTransformer": null, "pullJEXLTransformer": null, "transformers": [] }, { "intAttrName": "prenom", "extAttrName": "prenom", "connObjectKey": false, "password": false, "mandatoryCondition": "false", "purpose": "PULL", "propagationJEXLTransformer": null, "pullJEXLTransformer": null, "transformers": [] }, { "intAttrName": "nom", "extAttrName": "nom", "connObjectKey": false, "password": false, "mandatoryCondition": "false", "purpose": "PULL", "propagationJEXLTransformer": null, "pullJEXLTransformer": null, "transformers": [] }, { "intAttrName": "operationalUnit", "extAttrName": "operationalUnit", "connObjectKey": false, "password": false, "mandatoryCondition": "false", "purpose": "PULL", "propagationJEXLTransformer": null, "pullJEXLTransformer": null, "transformers": [] }, { "intAttrName": "key", "extAttrName": "key", "connObjectKey": false, "password": false, "mandatoryCondition": "false", "purpose": "PROPAGATION", "propagationJEXLTransformer": null, "pullJEXLTransformer": null, "transformers": [] } ], "connObjectLink": null } } ], "orgUnit": null, "propagationPriority": 10, "enforceMandatoryCondition": true, "createTraceLevel": "ALL", "updateTraceLevel": "ALL", "deleteTraceLevel": "ALL", "provisioningTraceLevel": "ALL", "passwordPolicy": null, "accountPolicy": null, "propagationPolicy": null, "inboundPolicy": null, "pushPolicy": null, "provisionSorter": null, "authPolicy": null, "accessPolicy": null, "confOverrideFlag": true, "confOverrideValue": [], "capabilitiesOverrideFlag": false, "capabilitiesOverrideValue": null, "propagationActions": [ "Person2UserPropagationActions" ] }'Création de la tâche de traction / pull:
curl --location 'http://<CoreServer>/syncope/rest/tasks/PULL' \--header 'Content-Type: application/json' \--header 'Authorization: ••••••' \--data '{ "_class": "org.apache.syncope.common.lib.to.PullTaskTO", "cronExpression": null, "jobDelegate": "PullJobDelegate", "name": "chargePersons", "active": true, "resource": "person", "performCreate": true, "performUpdate": true, "performDelete": true, "syncStatus": false, "unmatchingRule": "PROVISION", "matchingRule": "UPDATE", "actions": [], "concurrentSettings": null, "destinationRealm": "/", "remediation": false, "pullMode": "INCRMENTAL", "reconFilterBuilder": null, "templates": {}}'