README revision 35d5aee48705598166a6bdf9185894a73f172bbb
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync/**
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync *
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * Copyright (c) 2014 ForgeRock AS. All rights reserved.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync *
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * The contents of this file are subject to the terms
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * of the Common Development and Distribution License
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * (the License). You may not use this file except in
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * compliance with the License.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync *
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * You can obtain a copy of the License at
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * http://forgerock.org/license/CDDLv1.0.html
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * See the License for the specific language governing
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * permission and limitations under the License.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync *
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * When distributing Covered Code, include this CDDL
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * Header Notice in each file and include the License file
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * at http://forgerock.org/license/CDDLv1.0.html
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * If applicable, add the following below the CDDL Header,
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * with the fields enclosed by brackets [] replaced by
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * your own identifying information:
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync * "Portions Copyrighted [year] [name of copyright owner]"
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync */
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsyncSample 5 - Synchronization of Two Resources
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync-------------------------------------------
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsyncThis sample demonstrates flowing data between external resources. It simulates
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsynctwo directory resources using XML files. It is different from sample4 in that
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsyncit routes changes through managed/user, rather than having them directly mapped
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsyncto each other. It also demonstrates the use of a reconciliation report delivered
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsyncvia email.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsyncFor documentation pertaining to this example see:
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsynchttp://openidm.forgerock.org/doc/install-guide/index.html#more-sample5
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsyncTo try the sample, follow these steps.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync Steps 1 and 2 are optional, and only necessary if you'd like to receive emailed recon summaries.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync 1. Copy the samples/misc/external.email.json file into samples/sample5/conf
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync $ cd /path/to/openidm
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync $ cp samples/misc/external.email.json samples/sample5/conf
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync Edit this file to have your email server SMTP details. See http://openidm.forgerock.org/doc/integrators-guide/index.html#chap-mail for more information.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync 2. Edit samples/sample5/script/reconStats.js and change these values to your own email addresses:
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync var params = {
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync //UPDATE THESE VALUES
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync from : "openidm@example.com",
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync to : "idmadmin1@example.com",
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync cc : "idmadmin2@example.com,idmadmin3@example.com",
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync subject : "Recon stats for " + global.reconName,
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync type : "text/html"
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync }
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync 3. Start OpenIDM with the configuration for sample 5.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync $ cd /path/to/openidm
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync $ ./startup.sh -p samples/sample5
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync When you start OpenIDM, it creates a data in the new external resource
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync file that represents an AD directory, samples/sample5/data/xml_AD_Data.xml.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync The new file is empty until you run reconciliation.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync 4. Run reconciliation.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync $ curl -k -H "Content-type: application/json" -u "openidm-admin:openidm-admin" -X POST "https://localhost:8443/openidm/recon?_action=recon&mapping=systemLdapAccounts_managedUser"
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync {"reconId":"b149f0e3-4bb9-4790-9266-fab2e5c80ec6"}
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync 5. Check
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync $ cat /path/to/openidm/samples/sample5/data/xml_AD_Data.xml
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <?xml version="1.0" encoding="UTF-8"?>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <icf:OpenICFContainer xmlns:icf="http://openidm.forgerock.com/xml/ns/public/resource/openicf/resource-schema-1.xsd"
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync xmlns:ri="http://openidm.forgerock.com/xml/ns/public/resource/instances/resource-schema-extension"
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync xsi:schemaLocation="http://openidm.forgerock.com/xml/ns/public/resource/instances/resource-schema-extension samples/sample5/data/resource-schema-extension.xsd http://openidm.forgerock.com/xml/ns/public/resource/openicf/resource-schema-1.xsd samples/sample5/data/resource-schema-1.xsd">
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <ri:__ACCOUNT__>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <ri:firstname>Darth</ri:firstname>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <icf:__DESCRIPTION__/>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <icf:__GROUPS__/>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <icf:__UID__>68077c05-32ae-4438-b250-d23be784ea07</icf:__UID__>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <icf:__NAME__>DDOE1</icf:__NAME__>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <ri:email>mail1@example.com</ri:email>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <icf:__PASSWORD__>initial_Passw0rd</icf:__PASSWORD__>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <icf:__ENABLE__/>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync <ri:lastname>Doe</ri:lastname>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync </ri:__ACCOUNT__>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync </icf:OpenICFContainer>
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync 6. Create a new user in the source external resource file,
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync samples/sample5/data/xml_LDAP_Data.xml, and run reconciliation again
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync to see the result show up in samples/sample5/data/xml_AD_Data.xml.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync 7. Login to the UI at https://localhost:8443/openidmui. You can use openidm-admin/openidm-admin for admin access or
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync DDOE1/TestPassw0rd2 for non-admin access. Updates to DDOE1 will be synced backed to both XML files.
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync 8. If you have configured the recon email summary in steps 1 and 2, you should have gotten an email
3ac4cd918f9ffed59c4cc988665d1e09c5d7304avboxsync that lists the details for the reconciliation.