A separate system needs to make an authenticated Rest-based call to AEM 6.1 author, with the user ID to-be-synched, and then that user needs to be synchronized (from LDAP) into the AEM author user store. AEM should provide an exit code, success or failure, etc.

I can do this now with curl (if LDAP, etc. are configured in /system/console/configMgr).

curl -u "admin:admin" -X POST --data p1="['uid=tst2,ou=People,o=abc.com,o=abc']" http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Ahandler%3D%22default%22%2Cidp%3...

But I want to do this via a Rest/Sling/OSGi service, avoiding system calls like curl, scp/ssh, etc., as the system making the call is Rest-based.

What's the best way to go about this? I envision an OSGi bundle (with a config screen for anything related), that exposes a Java method to sync the user, but don't have the first idea on where to start.

Thanks for any info,
Bill