7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel/**
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel *
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * Copyright (c) 2014 ForgeRock AS. All rights reserved.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel *
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * The contents of this file are subject to the terms
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * of the Common Development and Distribution License
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * (the License). You may not use this file except in
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * compliance with the License.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel *
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * You can obtain a copy of the License at
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * http://forgerock.org/license/CDDLv1.0.html
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * See the License for the specific language governing
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * permission and limitations under the License.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel *
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * When distributing Covered Code, include this CDDL
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * Header Notice in each file and include the License file
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * at http://forgerock.org/license/CDDLv1.0.html
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * If applicable, add the following below the CDDL Header,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * with the fields enclosed by brackets [] replaced by
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * your own identifying information:
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel * "Portions Copyrighted [year] [name of copyright owner]"
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel */
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
1199b6a39a6d63b47cf461c675746b403cee0397omeboldAsync reconciliation Sample
4b4c3a2028eea921136be5b4717c69c074b4982eLana---------------------------
1199b6a39a6d63b47cf461c675746b403cee0397omebold
4b4c3a2028eea921136be5b4717c69c074b4982eLanaThis sample demonstrates how to perform an asynchronous action from a
4b4c3a2028eea921136be5b4717c69c074b4982eLanareconciliation.
4b4c3a2028eea921136be5b4717c69c074b4982eLana
4b4c3a2028eea921136be5b4717c69c074b4982eLanaFor documentation pertaining to this example see:
17ac9740889daa3a239caefc6fb8615c60b5a6d1Lana Frosthttp://openidm.forgerock.org/doc/bootstrap/samples-guide/#more-sample-9
1199b6a39a6d63b47cf461c675746b403cee0397omebold
1199b6a39a6d63b47cf461c675746b403cee0397omeboldTo try the sample, follow these steps.
1199b6a39a6d63b47cf461c675746b403cee0397omebold
4b4c3a2028eea921136be5b4717c69c074b4982eLana 1. Start OpenIDM with the configuration for sample 9.
1199b6a39a6d63b47cf461c675746b403cee0397omebold
1199b6a39a6d63b47cf461c675746b403cee0397omebold $ cd /path/to/openidm
4b4c3a2028eea921136be5b4717c69c074b4982eLana $ ./startup.sh -p samples/sample9
1199b6a39a6d63b47cf461c675746b403cee0397omebold
4b4c3a2028eea921136be5b4717c69c074b4982eLana 2. Run reconciliation.
1199b6a39a6d63b47cf461c675746b403cee0397omebold
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel $ curl -k -H "Content-type: application/json" -u "openidm-admin:openidm-admin" -X POST "https://localhost:8443/openidm/recon?_action=recon&mapping=systemXmlfileAccounts_managedUser"
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel The reconciliation starts an approval workflow for each ABSENT user.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel These workflows (managedUserApproval) wait for approval.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake FeaselOption 1: Using the UI
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
e90f327dcf46d61cf847f239ef5af5a9ca431449Mike Jang 3. Using your browser, open https://localhost:8443/ .
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel Login with openidm-admin/openidm-admin.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 4. In your "My Tasks" list, you should see two requests for "Evaluate request".
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel Click on "Evaluate request" to expand the list, and then click "Details" for
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel each item. Choose whether or not to approve the request. If you choose "Yes",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel that user will be created. If you choose "No", it will not be.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 5. After completing all pending tasks, go to the "Users" tab to see the list of
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel managed/users defined in the system. Only those you approved should be listed.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake FeaselOption 2: Using curl
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 3. Query the started workflow task instances.
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel $ curl -k -u openidm-admin:openidm-admin "https://localhost:8443/openidm/workflow/taskinstance?_queryId=query-all-ids&_prettyPrint=true"
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel {
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "result" : [ {
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "tenantId" : "",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "createTime" : "2014-04-18T16:12:14.125-07:00",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "executionId" : "4",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "delegationStateString" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "processVariables" : { },
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "_id" : "15",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "processInstanceId" : "4",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "description" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "priority" : 50,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "name" : "Evaluate request",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "dueDate" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "parentTaskId" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "processDefinitionId" : "managedUserApproval:1:3",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "taskLocalVariables" : { },
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "suspensionState" : 1,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "assignee" : "openidm-admin",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "cachedElContext" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "queryVariables" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "activityInstanceVariables" : { },
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "deleted" : false,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "suspended" : false,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "_rev" : 1,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "revisionNext" : 2,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "category" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "taskDefinitionKey" : "evaluateRequest",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "owner" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "eventName" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "delegationState" : null
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel }, {
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "tenantId" : "",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "createTime" : "2014-04-18T16:12:14.178-07:00",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "executionId" : "16",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "delegationStateString" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "processVariables" : { },
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "_id" : "27",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "processInstanceId" : "16",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "description" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "priority" : 50,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "name" : "Evaluate request",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "dueDate" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "parentTaskId" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "processDefinitionId" : "managedUserApproval:1:3",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "taskLocalVariables" : { },
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "suspensionState" : 1,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "assignee" : "openidm-admin",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "cachedElContext" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "queryVariables" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "activityInstanceVariables" : { },
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "deleted" : false,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "suspended" : false,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "_rev" : 1,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "revisionNext" : 2,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "category" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "taskDefinitionKey" : "evaluateRequest",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "owner" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "eventName" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "delegationState" : null
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel } ],
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "resultCount" : 2,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "pagedResultsCookie" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "remainingPagedResults" : -1
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel }
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 4. Approve the request.
1199b6a39a6d63b47cf461c675746b403cee0397omebold
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel $ 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"
1199b6a39a6d63b47cf461c675746b403cee0397omebold
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel 5. Query the managed users created by the asynchronous reconciliation after
4b4c3a2028eea921136be5b4717c69c074b4982eLana the approval step.
3dfd9546d8b1fd911523672bf4a23ce77f60f847Matthias Tristl
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel $ curl -k -u openidm-admin:openidm-admin "https://localhost:8443/openidm/managed/user?_queryId=query-all-ids&_prettyPrint=true"
d5cc23b8435816829705af98bc0abac80f18b95domebold
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel {
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "result" : [ {
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "_id" : "bjensen",
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "_rev" : "0"
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel } ],
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "resultCount" : 1,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "pagedResultsCookie" : null,
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel "remainingPagedResults" : -1
7d83b6a03bd7b63f2eb6404d6cc1e4c074391ea7Jake Feasel }