-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing create_user flow + Refactoring to use http_graph_action
- Loading branch information
Petr Panuska
committed
May 7, 2020
1 parent
fab5330
commit 523465d
Showing
7 changed files
with
172 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
office365/Content/Library/office365/_tools/http_graph_action.sl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
namespace: office365._tools | ||
flow: | ||
name: http_graph_action | ||
inputs: | ||
- url | ||
- token | ||
- method | ||
- body: | ||
required: false | ||
workflow: | ||
- http_client_action: | ||
do: | ||
io.cloudslang.base.http.http_client_action: | ||
- url: "${'https://graph.microsoft.com/v1.0%s' % url}" | ||
- auth_type: anonymous | ||
- proxy_host: "${get_sp('proxy_host')}" | ||
- proxy_port: "${get_sp('proxy_port')}" | ||
- proxy_username: "${get_sp('proxy_username')}" | ||
- proxy_password: | ||
value: "${get_sp('proxy_password')}" | ||
sensitive: true | ||
- trust_all_roots: 'false' | ||
- x_509_hostname_verifier: strict | ||
- headers: "${'Authorization: Bearer ' + token}" | ||
- body: '${body}' | ||
- content_type: application/json | ||
- method: '${method}' | ||
publish: | ||
- return_result | ||
- error_message | ||
- status_code | ||
- return_code | ||
- response_headers | ||
navigate: | ||
- SUCCESS: SUCCESS | ||
- FAILURE: on_failure | ||
outputs: | ||
- return_result: '${return_result}' | ||
- response_headers: '${response_headers}' | ||
- error_message: '${error_message}' | ||
- status_code: '${status_code}' | ||
- return_code: '${return_code}' | ||
results: | ||
- FAILURE | ||
- SUCCESS | ||
extensions: | ||
graph: | ||
steps: | ||
http_client_action: | ||
x: 85 | ||
'y': 96 | ||
navigate: | ||
157930d8-a607-4c4d-9e14-cf9639670613: | ||
targetId: 4e80e608-6286-2b58-a16a-2847a30b06d5 | ||
port: SUCCESS | ||
results: | ||
SUCCESS: | ||
4e80e608-6286-2b58-a16a-2847a30b06d5: | ||
x: 253 | ||
'y': 91 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
######################################################################################################################## | ||
#!! | ||
#! @input user_principal_name: Unique identifier of the user | ||
#! @input force_change_password: Force the user to change his/her password first time he/she signs in | ||
#!!# | ||
######################################################################################################################## | ||
namespace: office365.user | ||
flow: | ||
name: create_user | ||
inputs: | ||
- display_name: Test | ||
- mail_nick_name: test | ||
- user_principal_name: test@rpamf.onmicrosoft.com | ||
- password: | ||
sensitive: true | ||
- force_change_password: 'false' | ||
workflow: | ||
- authenticate: | ||
do: | ||
office365.auth.authenticate: [] | ||
publish: | ||
- token | ||
navigate: | ||
- FAILURE: on_failure | ||
- SUCCESS: http_graph_action | ||
- http_graph_action: | ||
do: | ||
office365._tools.http_graph_action: | ||
- url: /users | ||
- token: '${token}' | ||
- method: POST | ||
- body: |- | ||
${''' | ||
{ | ||
"accountEnabled": true, | ||
"displayName": "%s", | ||
"mailNickname": "%s", | ||
"userPrincipalName": "%s", | ||
"passwordProfile" : { | ||
"forceChangePasswordNextSignIn": %s, | ||
"password": "%s" | ||
} | ||
} | ||
''' % (display_name, mail_nick_name, user_principal_name, force_change_password, password)} | ||
publish: | ||
- json: '${return_result}' | ||
navigate: | ||
- FAILURE: on_failure | ||
- SUCCESS: SUCCESS | ||
outputs: | ||
- json: '${json}' | ||
results: | ||
- FAILURE | ||
- SUCCESS | ||
extensions: | ||
graph: | ||
steps: | ||
http_graph_action: | ||
x: 229 | ||
'y': 83 | ||
navigate: | ||
297032fa-a883-67fe-0ef2-c59f849f7d77: | ||
targetId: f9ca98c4-3b22-08dc-b07e-53dfa4d7d54f | ||
port: SUCCESS | ||
authenticate: | ||
x: 55 | ||
'y': 88 | ||
results: | ||
SUCCESS: | ||
f9ca98c4-3b22-08dc-b07e-53dfa4d7d54f: | ||
x: 393 | ||
'y': 81 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters