You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3. Navigate to the Directory Sync example app within the cloned repo.
29
+
2. Navigate to the Directory Sync example app within the cloned repo.
35
30
```bash
36
31
$ cd python-flask-example-applications/python-flask-directory-sync-example
37
32
```
38
33
39
-
4. Create and source a Python virtual environment. You should then see `(env)` at the beginning of your command-line prompt.
34
+
3. Create and source a Python virtual environment. You should then see `(env)` at the beginning of your command-line prompt.
40
35
```bash
41
36
$ python3 -m venv env
42
37
$ source env/bin/activate
@@ -45,33 +40,33 @@ If you get stuck, please reach out to us at [email protected] so we can help.
45
40
46
41
### Install Dependencies
47
42
48
-
5. Install the cloned app's dependencies.
43
+
4. Install the cloned app's dependencies.
49
44
```bash
50
45
(env) $ pip install -r requirements.txt
51
46
```
52
47
53
48
### Set Environment Variables
54
49
55
-
6. Obtain and make note of the following values. In the next step, these will be set as environment variables.
50
+
5. Obtain and make note of the following values. In the next step, these will be set as environment variables.
56
51
- Your [WorkOS API key](https://dashboard.workos.com/api-keys)
57
52
- Your `WEBHOOKS_SECRET`, retrievable from the URL in the WEBHOOKS area of the WorkOS dashboard. This is only required if you are utilizing the webhooks route of this application to receive and validate webhook events.
58
53
59
54
60
-
7. Ensure you're in the root directory for the example app, `python-flask-directory-sync-example/`. Create a `.env` file to securely store the environment variables. Open this file with the Nano text editor. (This file is listed in this repo's `.gitignore` file, so your sensitive information will not be checked into version control.)
55
+
6. Ensure you're in the root directory for the example app, `python-flask-directory-sync-example/`. Create a `.env` file to securely store the environment variables. Open this file with the Nano text editor. (This file is listed in this repo's `.gitignore` file, so your sensitive information will not be checked into version control.)
61
56
```bash
62
57
(env) $ touch .env
63
58
(env) $ nano .env
64
59
```
65
60
66
-
8. Once the Nano text editor opens, you can directly edit the `.env` file by listing the environment variables:
61
+
7. Once the Nano text editor opens, you can directly edit the `.env` file by listing the environment variables:
67
62
```bash
68
63
export WORKOS_API_KEY=<value found in step 6>
69
64
export WEBHOOKS_SECRET=<value found in step 6>
70
65
```
71
66
72
67
To exit the Nano text editor, type`CTRL + x`. When prompted to "Save modified buffer", type`Y`, then press the `Enter` or `Return` key.
73
68
74
-
9. Source the environment variables so they are accessible to the operating system.
69
+
8. Source the environment variables so they are accessible to the operating system.
75
70
```bash
76
71
(env) $ source .env
77
72
```
@@ -84,7 +79,7 @@ If you get stuck, please reach out to us at [email protected] so we can help.
84
79
85
80
## Start the server
86
81
87
-
10. Use this command to run the app:
82
+
9. Use this command to run the app:
88
83
```bash
89
84
flask run
90
85
```
@@ -94,7 +89,7 @@ If you get stuck, please reach out to us at [email protected] so we can help.
94
89
(env) $ flask run -p 5001
95
90
```
96
91
97
-
11. Once the server is running, navigate to `http://localhost:5000`, or `http://localhost:5001` depending on which port you launched the server, to view the home page of the app where you can then select the view for users or groups.
92
+
10. Once the server is running, navigate to `http://localhost:5000`, or `http://localhost:5001` depending on which port you launched the server, to view the home page of the app where you can then select the view for users or groups.
98
93
99
94
- The `/users` URL corresponds to the WorkOS API's [List Directory Users endpoint](https://workos.com/docs/reference/directory-sync/user/list)
100
95
- The `/groups` URL corresponds to the WorkOS API's [List Directory Groups endpoint](https://workos.com/docs/reference/directory-sync/group/list)
@@ -103,7 +98,7 @@ If you get stuck, please reach out to us at [email protected] so we can help.
103
98
104
99
## Test Webhooks
105
100
106
-
12. WorkOS sends Webhooks as a way of managing updates to Directory Sync connections. The Webhooks section of the WorkOS Dashboard allows you to send test webhooks to your application. The Test Webhooks section of this application allows you to visualize the validated webhooks directly in this application in real-time. [Please review the tutorial here](https://workos.com/blog/test-workos-webhooks-locally-ngrok) for details on how this can be done locally.
101
+
11. WorkOS sends Webhooks as a way of managing updates to Directory Sync connections. The Webhooks section of the WorkOS Dashboard allows you to send test webhooks to your application. The Test Webhooks section of this application allows you to visualize the validated webhooks directly in this application in real-time. [Please review the tutorial here](https://workos.com/blog/test-workos-webhooks-locally-ngrok) for details on how this can be done locally.
0 commit comments