-
Notifications
You must be signed in to change notification settings - Fork 0
/
microsoft-azure-api-authenticate.bpmn
102 lines (101 loc) · 5.74 KB
/
microsoft-azure-api-authenticate.bpmn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_0sdny8d" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.2.0">
<bpmn:process id="dynamics-365-business-central-auth" name="Onify Blueprint: Dynamics 365 Business Central Authentication" isExecutable="true">
<bpmn:startEvent id="start" name="Generate access token">
<bpmn:outgoing>Flow_0wk332j</bpmn:outgoing>
</bpmn:startEvent>
<bpmn:endEvent id="end" name="Access token generated">
<bpmn:incoming>Flow_0t7vdw4</bpmn:incoming>
</bpmn:endEvent>
<bpmn:serviceTask id="generateAccessToken" name="Generate Azure access token">
<bpmn:extensionElements>
<camunda:connector>
<camunda:inputOutput>
<camunda:inputParameter name="form">
<camunda:map>
<camunda:entry key="client_id">${environment.output.azureCredentials.client_id}</camunda:entry>
<camunda:entry key="scope">https://graph.microsoft.com/.default</camunda:entry>
<camunda:entry key="client_secret">${environment.output.azureCredentials.client_secret}</camunda:entry>
<camunda:entry key="grant_type">client_credentials</camunda:entry>
</camunda:map>
</camunda:inputParameter>
<camunda:inputParameter name="responseType">json</camunda:inputParameter>
<camunda:inputParameter name="method">POST</camunda:inputParameter>
<camunda:inputParameter name="headers">
<camunda:map>
<camunda:entry key="Content-Type">application/x-www-form-urlencoded</camunda:entry>
</camunda:map>
</camunda:inputParameter>
<camunda:inputParameter name="url">https://login.microsoftonline.com/${environment.output.azureCredentials.tenant}/oauth2/v2.0/token</camunda:inputParameter>
<camunda:inputParameter name="throwHttpErrors">${true}</camunda:inputParameter>
<camunda:outputParameter name="body">${body}</camunda:outputParameter>
</camunda:inputOutput>
<camunda:connectorId>httpRequest</camunda:connectorId>
</camunda:connector>
<camunda:inputOutput>
<camunda:outputParameter name="accessToken">${content.output.body.access_token}</camunda:outputParameter>
<camunda:outputParameter name="output">${content.output.body.access_token}</camunda:outputParameter>
<camunda:outputParameter name="debugLog">
<camunda:script scriptFormat="js">// Remove this logging once it works :)
console.log(content.output.body);
next();</camunda:script>
</camunda:outputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0gaktxo</bpmn:incoming>
<bpmn:outgoing>Flow_0t7vdw4</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_0wk332j" sourceRef="start" targetRef="getAzureCredentials" />
<bpmn:sequenceFlow id="Flow_0t7vdw4" sourceRef="generateAccessToken" targetRef="end" />
<bpmn:serviceTask id="getAzureCredentials" name="Get Azure credentials">
<bpmn:extensionElements>
<camunda:connector>
<camunda:inputOutput>
<camunda:inputParameter name="url">/my/config/settings/_azure_credentials</camunda:inputParameter>
</camunda:inputOutput>
<camunda:connectorId>onifyApiRequest</camunda:connectorId>
</camunda:connector>
<camunda:inputOutput>
<camunda:outputParameter name="azureCredentials">${content.output.body.value}</camunda:outputParameter>
</camunda:inputOutput>
</bpmn:extensionElements>
<bpmn:incoming>Flow_0wk332j</bpmn:incoming>
<bpmn:outgoing>Flow_0gaktxo</bpmn:outgoing>
</bpmn:serviceTask>
<bpmn:sequenceFlow id="Flow_0gaktxo" sourceRef="getAzureCredentials" targetRef="generateAccessToken" />
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="dynamics-365-business-central-auth">
<bpmndi:BPMNEdge id="Flow_0gaktxo_di" bpmnElement="Flow_0gaktxo">
<di:waypoint x="380" y="117" />
<di:waypoint x="456" y="117" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0t7vdw4_di" bpmnElement="Flow_0t7vdw4">
<di:waypoint x="556" y="117" />
<di:waypoint x="622" y="117" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="Flow_0wk332j_di" bpmnElement="Flow_0wk332j">
<di:waypoint x="198" y="117" />
<di:waypoint x="280" y="117" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="start">
<dc:Bounds x="162" y="99" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="139" y="142" width="84" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Event_10fxhsy_di" bpmnElement="end">
<dc:Bounds x="622" y="99" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="608" y="142" width="65" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_1mbrrq0_di" bpmnElement="generateAccessToken">
<dc:Bounds x="456" y="77" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="Activity_02vz536_di" bpmnElement="getAzureCredentials">
<dc:Bounds x="280" y="77" width="100" height="80" />
</bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>