README revision 856298a52144e5cf88ebef4f32fd6eb6616c2213
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder/**
25cc5fbba63f84b47e389af749f55abbbde71c8cChristian Maeder * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
25cc5fbba63f84b47e389af749f55abbbde71c8cChristian Maeder *
25cc5fbba63f84b47e389af749f55abbbde71c8cChristian Maeder * Copyright (c) 2014 ForgeRock AS. All rights reserved.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder *
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder * The contents of this file are subject to the terms
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder * of the Common Development and Distribution License
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder * (the License). You may not use this file except in
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder * compliance with the License.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder *
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder * You can obtain a copy of the License at
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder * http://forgerock.org/license/CDDLv1.0.html
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder * See the License for the specific language governing
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder * permission and limitations under the License.
0898ff703a21cf78e18cc03e8fe5a3c6d1fc25c3Christian Maeder *
08e5741dd8b6bf9b7419e89298e384e18bc57f64Christian Maeder * When distributing Covered Code, include this CDDL
b7839add0728fef3cbb28244373661db382f6588Christian Maeder * Header Notice in each file and include the License file
ce8b15da31cd181b7e90593cbbca98f47eda29d6Till Mossakowski * at http://forgerock.org/license/CDDLv1.0.html
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder * If applicable, add the following below the CDDL Header,
760ae19a92dde8249679a674f93f58d26a7c5f6bChristian Maeder * with the fields enclosed by brackets [] replaced by
760ae19a92dde8249679a674f93f58d26a7c5f6bChristian Maeder * your own identifying information:
88c800932dd7053322501ea2039d9f234be6866cKlaus Luettich * "Portions Copyrighted [year] [name of copyright owner]"
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder */
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder
c0c2380bced8159ff0297ece14eba948bd236471Christian MaederAsync reconciliation Sample
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder---------------------------
8410667510a76409aca9bb24ff0eda0420088274Christian Maeder
8410667510a76409aca9bb24ff0eda0420088274Christian MaederThis sample demonstrates how to perform an asynchronous action from a
8410667510a76409aca9bb24ff0eda0420088274Christian Maederreconciliation.
404166b9366552e9ec5abb87a37c76ec8a815fb7Klaus Luettich
404166b9366552e9ec5abb87a37c76ec8a815fb7Klaus LuettichFor documentation pertaining to this example see:
824125ad97b34671bd7ea72655967f46caeb0004Christian Maederhttp://openidm.forgerock.org/doc/install-guide/index.html#more-sample9
404166b9366552e9ec5abb87a37c76ec8a815fb7Klaus Luettich
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian MaederTo try the sample, follow these steps.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
d67a33b40578beef2e255a274f89bb9c34aaf056Christian Maeder 1. Start OpenIDM with the configuration for sample 9.
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder
e593b89bfd4952698dc37feced21cefe869d87a2Christian Maeder $ cd /path/to/openidm
ac0bbbcb2774629bb87986e69cf53d3402c5f575Christian Maeder $ ./startup.sh -p samples/sample9
6e049108aa87dc46bcff96fae50a4625df1d9648Klaus Luettich
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder 2. Run reconciliation.
5ae37a27aea7c5f3b8e66ed437794c7ef47a8680Christian Maeder
c6fcd42c6d6d9dae8c7835c24fcb7ce8531a9050Christian Maeder $ curl -k -H "Content-type: application/json" -u "openidm-admin:openidm-admin" -X POST "https://localhost:8443/openidm/recon?_action=recon&mapping=systemXmlfileAccounts_managedUser"
c6fcd42c6d6d9dae8c7835c24fcb7ce8531a9050Christian Maeder
31c49f2fa23d4ac089f35145d80a224deb6ea7e4Till Mossakowski The reconciliation starts an approval workflow for each ABSENT user.
c55a0f77be7e88d3620b419ec8961f4379a586e3Klaus Luettich These workflows (managedUserApproval) wait for approval.
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder
9e748851c150e1022fb952bab3315e869aaf0214Christian MaederOption 1: Using the UI
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder
d3ae0072823e2ef0d41d4431fcc768e66489c20eChristian Maeder 3. Using your browser, open https://localhost:8443/selfservice/ .
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder Login with openidm-admin/openidm-admin.
f4505a64a089693012a3f5c3b1f12a82cd7a2a5aKlaus Luettich
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder 4. In your "My Tasks" list, you should see two requests for "Evaluate request".
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder Click on "Evaluate request" to expand the list, and then click "Details" for
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder each item. Choose whether or not to approve the request. If you choose "Yes",
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder that user will be created. If you choose "No", it will not be.
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder 5. After completing all pending tasks, go to the "Users" tab to see the list of
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder managed/users defined in the system. Only those you approved should be listed.
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder
9e748851c150e1022fb952bab3315e869aaf0214Christian MaederOption 2: Using curl
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder 3. Query the started workflow task instances.
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder $ curl -k -u openidm-admin:openidm-admin "https://localhost:8443/openidm/workflow/taskinstance?_queryId=query-all-ids&_prettyPrint=true"
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder {
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "result" : [ {
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "tenantId" : "",
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "createTime" : "2014-04-18T16:12:14.125-07:00",
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "executionId" : "4",
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "delegationStateString" : null,
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "processVariables" : { },
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "_id" : "15",
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder "processInstanceId" : "4",
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder "description" : null,
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder "priority" : 50,
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder "name" : "Evaluate request",
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder "dueDate" : null,
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "parentTaskId" : null,
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "processDefinitionId" : "managedUserApproval:1:3",
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "taskLocalVariables" : { },
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "suspensionState" : 1,
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "assignee" : "openidm-admin",
f4505a64a089693012a3f5c3b1f12a82cd7a2a5aKlaus Luettich "cachedElContext" : null,
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "queryVariables" : null,
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "activityInstanceVariables" : { },
f4505a64a089693012a3f5c3b1f12a82cd7a2a5aKlaus Luettich "deleted" : false,
f4505a64a089693012a3f5c3b1f12a82cd7a2a5aKlaus Luettich "suspended" : false,
f4505a64a089693012a3f5c3b1f12a82cd7a2a5aKlaus Luettich "_rev" : 1,
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich "revisionNext" : 2,
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "category" : null,
c0c2380bced8159ff0297ece14eba948bd236471Christian Maeder "taskDefinitionKey" : "evaluateRequest",
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "owner" : null,
77a65251ee036c6aaf09c2775315a4ee24259fbdJorina Freya Gerken "eventName" : null,
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "delegationState" : null
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder }, {
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "tenantId" : "",
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "createTime" : "2014-04-18T16:12:14.178-07:00",
97812b7ce9860bf514a8822a63503451795dbc65Klaus Luettich "executionId" : "16",
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "delegationStateString" : null,
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "processVariables" : { },
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "_id" : "27",
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "processInstanceId" : "16",
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "description" : null,
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "priority" : 50,
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "name" : "Evaluate request",
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "dueDate" : null,
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder "parentTaskId" : null,
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder "processDefinitionId" : "managedUserApproval:1:3",
08e5741dd8b6bf9b7419e89298e384e18bc57f64Christian Maeder "taskLocalVariables" : { },
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "suspensionState" : 1,
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "assignee" : "openidm-admin",
5191fa24c532d1f67e7a642e9aece65efb8a0975Christian Maeder "cachedElContext" : null,
9df11f85fd7f8c4745d64464876e84ec4e263692Christian Maeder "queryVariables" : null,
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers "activityInstanceVariables" : { },
9df11f85fd7f8c4745d64464876e84ec4e263692Christian Maeder "deleted" : false,
5b818f10e11fc79def1fdd5c8a080d64a6438d87Christian Maeder "suspended" : false,
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers "_rev" : 1,
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich "revisionNext" : 2,
5d4038657f6a63e131f5804af2f7957b69e15a43Klaus Luettich "category" : null,
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "taskDefinitionKey" : "evaluateRequest",
c432483b64662e8db604a58758cd18ea7fa65659Christian Maeder "owner" : null,
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder "eventName" : null,
857992065be4ed40a72c6296b6c0aec62ab4c5b9Christian Maeder "delegationState" : null
8659594bb40eb5f3da5439692f0908300947191eSonja Gröning } ],
8c692d0cc44e7df93f58a3eed0d9774ba5908339Jorina Freya Gerken "resultCount" : 2,
eeb419aa20c97b4af973e97ee6ae77a8eed29e15Till Mossakowski "pagedResultsCookie" : null,
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers "remainingPagedResults" : -1
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder }
9e748851c150e1022fb952bab3315e869aaf0214Christian Maeder
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder 4. Approve the request.
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder $ curl -k -u openidm-admin:openidm-admin -X POST "https://localhost:8443/openidm/workflow/taskinstance/15?_action=complete" --data '{"requestApproved": "true"}' -H "Content-Type: application/json"
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder 5. Query the managed users created by the asynchronous reconciliation after
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder the approval step.
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder $ curl -k -u openidm-admin:openidm-admin "https://localhost:8443/openidm/managed/user?_queryId=query-all-ids&_prettyPrint=true"
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder {
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "result" : [ {
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "_id" : "bjensen",
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "_rev" : "0"
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder } ],
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "resultCount" : 1,
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "pagedResultsCookie" : null,
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder "remainingPagedResults" : -1
8b0f493ae42bad8b94918cc0957f1af57096cda4Felix Reckers }
61fa0ac06ede811c7aad54ec4c4202346727368eChristian Maeder