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