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
Copy file name to clipboardExpand all lines: python-flask-admin-portal-example/README.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,7 @@ An example Flask application demonstrating how to use the [WorkOS Python SDK](ht
70
70
(env) $ echo $WORKOS_CLIENT_ID
71
71
```
72
72
73
-
10. Update the Admin Portal Redirect Link in the "Configuration" page of your WorkOS Dashboard. The URL should be http://localhost:5000.
73
+
10. Update the Admin Portal Redirect Link in the "Configuration" page of your WorkOS Dashboard. The URL should be http://localhost:5000. If you are using Mac OS Monterey, set this to localhost:5001.
74
74
75
75
After an Admin Portal user creates an SSO connection using the Admin Portal, they need to be redirected to a webpage within your application (usually this webpage confirms successful creation of the connection). To configure which webpage this is, enter the webpage’s URL in the Configuration section of your WorkOS dashboard under the “Admin Portal Redirect Link” header. For production usage this URL must begin with HTTPS, but for development purposes the URL can begin with HTTP.
76
76
@@ -81,6 +81,11 @@ After an Admin Portal user creates an SSO connection using the Admin Portal, the
81
81
(env) $ flask run
82
82
```
83
83
84
+
If you are using Mac OS Monterey, port 5000 is not available and you'll need to start the app on a different port with this slightly different command.
85
+
```bash
86
+
(env) $ flask run -p 5001
87
+
```
88
+
84
89
You'll know the server is running when you see no errors in the CLI, and output similar to the following is displayed:
85
90
86
91
```bash
@@ -92,7 +97,7 @@ After an Admin Portal user creates an SSO connection using the Admin Portal, the
92
97
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
93
98
```
94
99
95
-
Navigate to `localhost:5000`in your web browser to view the homepage of the Admin Portal example app. Enter the name of the new Organization to be created and the names of all of the Organization's associated domains.
100
+
Navigate to `localhost:5000`, or `localhost:5001` depending on which port you launched the server, in your web browser to view the homepage of the Admin Portal example app. Enter the name of the new Organization to be created and the names of all of the Organization's associated domains.
96
101
97
102
- The Organization must be a new Organization that doesn't yet exist in your WorkOS dashboard
98
103
- The domains should be entered as space-separated values, e.g. "domain1.com domain2.com domain3.com"
Copy file name to clipboardExpand all lines: python-flask-directory-sync-example/README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,7 +89,12 @@ If you get stuck, please reach out to us at [email protected] so we can help.
89
89
flask run
90
90
```
91
91
92
-
11. Once the server is running, navigate to http://localhost:5000 to view the home page of the app where you can thenselectthe view for users or groups.
92
+
If you are using Mac OS Monterey, port 5000 is not available and you'll need to start the app on a different port with this slightly different command.
93
+
```bash
94
+
(env) $ flask run -p 5001
95
+
```
96
+
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.
93
98
94
99
- The `/users` URL corresponds to the WorkOS API's [List Directory Users endpoint](https://workos.com/docs/reference/directory-sync/user/list)
95
100
- The `/groups` URL corresponds to the WorkOS API's [List Directory Groups endpoint](https://workos.com/docs/reference/directory-sync/group/list)
Copy file name to clipboardExpand all lines: python-flask-magic-link-example/README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,11 @@ An example Flask application demonstrating how to use the [WorkOS Python SDK](ht
76
76
(env) $ flask run
77
77
```
78
78
79
+
If you are using Mac OS Monterey, port 5000 is not available and you'll need to start the app on a different port with this slightly different command.
80
+
```bash
81
+
(env) $ flask run -p 5001
82
+
```
83
+
79
84
You'll know the server is running when you see no errors in the CLI, and output similar to the following is displayed:
80
85
81
86
```bash
@@ -87,18 +92,18 @@ An example Flask application demonstrating how to use the [WorkOS Python SDK](ht
87
92
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
88
93
```
89
94
90
-
Navigate to `localhost:5000`in your web browser. You should see a "Login" button.
95
+
Navigate to `localhost:5000`, or `localhost:5001` depending on which port you launched the server, in your web browser. You should see a "Login" button.
91
96
92
97
You can stop the local Flask server for now by entering `CTRL + c` on the command line.
93
98
94
99
95
100
## Magic Link Setup with WorkOS
96
101
97
-
Change the default REDIRECT_URI value in the "Configuration" page of your WorkOS dashboard to http://localhost:5000/success.
102
+
Change the default REDIRECT_URI value in the "Configuration" page of your WorkOS dashboard to `http://localhost:5000/success`, or `http://localhost:5001/success` depending on which port you launched the server.
98
103
99
104
## Testing the Integration
100
105
101
-
1. Naviagte to http://localhost:5000 to test out the Magic Link flow!
106
+
1. Naviagte to http://localhost:5000, or `http://localhost:5001/success` depending on which port you launched the server, to test out the Magic Link flow!
Copy file name to clipboardExpand all lines: python-flask-sso-example/README.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,13 +71,18 @@ An example Flask application demonstrating how to use the [WorkOS Python SDK](ht
71
71
(env) $ echo$WORKOS_CLIENT_ID
72
72
```
73
73
74
-
10. In `python-flask-sso-example/app.py` change the `CUSTOMER_EMAIL_DOMAIN` string value to an email domain that makes sense for your testing purposes if the default `gmail.com` isn't relevant. If you'd like to establish auth connection via Connection_ID instead, please change the `CUSTOMER_CONNECTION_ID` to your organization's connectionID.
74
+
10. In `python-flask-sso-example/app.py` change the `CUSTOMER_CONNECTION_ID` string value to the connection you will be testing the login for. This can be found in your WorkOS Dashboard.
75
75
76
76
11. The final setup step is to start the server.
77
77
```bash
78
78
(env) $ flask run
79
79
```
80
80
81
+
If you are using Mac OS Monterey, port 5000 is not available and you'll need to start the app on a different port with this slightly different command.
82
+
```bash
83
+
(env) $ flask run -p 5001
84
+
```
85
+
81
86
You'll know the server is running when you see no errors in the CLI, and output similar to the following is displayed:
82
87
83
88
```bash
@@ -89,7 +94,7 @@ An example Flask application demonstrating how to use the [WorkOS Python SDK](ht
89
94
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
90
95
```
91
96
92
-
Navigate to `localhost:5000` in your web browser. You should see a "Login" button. If you click this link, you'll be redirected to an HTTP `404` page because we haven't set up SSO yet!
97
+
Navigate to `localhost:5000`, or `localhost:5001` depending on which port you launched the server, in your web browser. You should see a "Login" button. If you click this link, you'll be redirected to an HTTP `404` page because we haven't set up SSO yet!
93
98
94
99
You can stop the local Flask server for now by entering `CTRL + c` on the command line.
95
100
@@ -104,15 +109,15 @@ If you get stuck, please reach out to us at [email protected] so we can help.
104
109
105
110
## Testing the Integration
106
111
107
-
1. Naviagte to the `python-flask-sso-example` directory. Source the virtual environment we created earlier, if it isn't still activated from the steps above. Start the Flask server locally.
112
+
12. Naviagte to the `python-flask-sso-example` directory. Source the virtual environment we created earlier, if it isn't still activated from the steps above. Start the Flask server locally.
108
113
109
114
```bash
110
115
$ cd~/Desktop/python-flask-sso-example/
111
116
$ source env/bin/activate
112
117
(env) $ flask run
113
118
```
114
119
115
-
Once running, navigate to http://localhost:5000 to test out the SSO workflow.
120
+
Once running, navigate to `localhost:5000`, or `localhost:5001` depending on which port you launched the server, to test out the SSO workflow.
0 commit comments