README revision 17ac9740889daa3a239caefc6fb8615c60b5a6d1
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews/**
1fdd2470b625a58b57d0b155e6caf8c4fc0afe8aAutomatic Updater * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews *
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * Copyright (c) 2014 ForgeRock AS. All rights reserved.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews *
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * The contents of this file are subject to the terms
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * of the Common Development and Distribution License
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * (the License). You may not use this file except in
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * compliance with the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews *
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * You can obtain a copy of the License at
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * http://forgerock.org/license/CDDLv1.0.html
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * See the License for the specific language governing
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * permission and limitations under the License.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews *
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * When distributing Covered Code, include this CDDL
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater * Header Notice in each file and include the License file
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * at http://forgerock.org/license/CDDLv1.0.html
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * If applicable, add the following below the CDDL Header,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * with the fields enclosed by brackets [] replaced by
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews * your own identifying information:
e21a2904f02a03fa06b6db04d348f65fe9c67b2bMark Andrews * "Portions Copyrighted [year] [name of copyright owner]"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews */
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
2a31bd531072824ef252c18303859d6af7451b00Francis DupontSample 7 - Scripting a SCIM-like Schema
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater---------------------------------------
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsThis sample demonstrates using scripting to expose users according to a
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsSCIM-like schema.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsFor documentation pertaining to this example see:
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewshttp://openidm.forgerock.org/doc/bootstrap/samples-guide/#more-sample-7
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
28b3569d6248168e6c00caab951521cc8141a49dAutomatic UpdaterNote that this sample does not work with the OpenIDM UI, due to the fact
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrewsthat the managed/user schema does not match the default.
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark AndrewsTo try the sample, follow these steps.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews 1. Start OpenIDM with the configuration for sample 7.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $ cd /path/to/openidm
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $ ./startup.sh -p samples/sample7
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews 2. Run reconciliation to copy the user from the XML file under data/ to
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews the OpenIDM internal repository. The scripts configured within sync.json
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews transform the user data to fit the SCIM-like schema.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $ curl -k -H "Content-type: application/json" -u "openidm-admin:openidm-admin" -X POST "https://localhost:8443/openidm/recon?_action=recon&mapping=systemXmlfileAccounts_managedUser"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater 3. Retrieve the user from the repository.
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews $ curl -k -u "openidm-admin:openidm-admin" -X GET "https://localhost:8443/openidm/managed/user/DDOE1?_prettyPrint=true"
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "_id" : "DDOE1",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "_rev" : "1",
d71e2e0c61df16ff37c9934c371a4a60c08974f7Mark Andrews "schemas" : "['urn:scim:schemas:core:1.0']",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "ims" : [ {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "type" : "aim",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "value" : "jonyOnAim"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews }, {
2cbb4ab75757fbb656997a82c14ca07db37d481aAutomatic Updater "type" : "skype",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "value" : "skyperHiasl"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews } ],
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "locale" : null,
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "phoneNumbers" : [ {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "type" : "work",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "value" : "1234567"
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater }, {
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "type" : "home",
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "value" : "1234568"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews } ],
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "emails" : [ {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "type" : "work",
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater "value" : "hallo@example.com",
731cc132f22dbc9e0ecd7035dce314a61076d31bAutomatic Updater "primary" : true
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews }, {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "type" : "home",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "value" : "jdoe@forgerock.com"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews } ],
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "externalId" : "DDOE1",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "preferredLanguage" : "en_US",
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "meta" : {
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "lastModified" : "Fri Apr 18 2014 15:15:33 GMT-0700 (PDT)",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "created" : "Fri Apr 18 2014 15:15:33 GMT-0700 (PDT)"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews },
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "userType" : "permanent",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "photos" : [ {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "type" : "photo",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "value" : "https://photos.example.com/profilephoto/72930000000Ccne/F"
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater }, {
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "type" : "thumbnail",
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "value" : "https://photos.example.com/profilephoto/72930000000Ccne/T"
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater } ],
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "title" : "Mr.Universe",
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "timezone" : "America/Denver",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "profileUrl" : "https://login.example.com/DDOE1",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "nickName" : "Jonny",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "name" : {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "familyName" : "Doe",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "middleName" : "Hias",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "formatted" : "Dr. John H Doe III",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "givenName" : "John",
2f8d63983c297c62630044d28a6f66676b4d339dMark Andrews "honorificSuffix" : "III",
2f8d63983c297c62630044d28a6f66676b4d339dMark Andrews "honorificPrefix" : "Dr."
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews },
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "userName" : "DDOE1",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "displayName" : "John Doe",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "addresses" : [ {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "streetAddress" : "100 Universal City Plaza",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "region" : "CA",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "formatted" : "100 Universal City Plaza\nHollywood, CA 91608 USA",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "postalCode" : "91608",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "primary" : "true",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "locality" : "Hollywood",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "type" : "work",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "country" : "USA"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews }, {
ca67ebfe9eef0b8f04179f7e511a19e0337a5422Automatic Updater "streetAddress" : "222 Universal City Plaza",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "region" : "CA",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "formatted" : "222 Universal City Plaza\nHollywood, CA 91622 USA",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "postalCode" : "91622",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "primary" : "false",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "locality" : "Hollywood",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "type" : "home",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "country" : "USA"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews } ],
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "groups" : [ {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "value" : "usemploys",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "display" : "US Employees"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews }, {
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "value" : "euemploys",
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews "display" : "EU Employees"
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews } ]
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews }
5a4557e8de2951a2796676b5ec4b6a90caa5be14Mark Andrews