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