scalekit-sdk-python 1.0.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- scalekit_sdk_python-1.0.2/PKG-INFO +140 -0
- scalekit_sdk_python-1.0.2/README.md +116 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/client.py +6 -4
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/common/scalekit.py +1 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/core.py +1 -1
- scalekit_sdk_python-1.0.2/scalekit/v1/connections/connections_pb2.py +409 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/connections/connections_pb2.pyi +114 -44
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/connections/connections_pb2_grpc.py +231 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/domains/domains_pb2.py +13 -7
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/domains/domains_pb2.pyi +12 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/domains/domains_pb2_grpc.py +33 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/organizations/organizations_pb2.py +43 -23
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/organizations/organizations_pb2.pyi +28 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/organizations/organizations_pb2_grpc.py +66 -0
- scalekit_sdk_python-1.0.2/scalekit/v1/user_profile_attributes/user_profile_attributes_pb2.py +83 -0
- scalekit_sdk_python-1.0.2/scalekit/v1/user_profile_attributes/user_profile_attributes_pb2.pyi +99 -0
- scalekit_sdk_python-1.0.2/scalekit/v1/user_profile_attributes/user_profile_attributes_pb2_grpc.py +174 -0
- scalekit_sdk_python-1.0.2/scalekit/v1/workspaces/__init__.py +0 -0
- scalekit_sdk_python-1.0.2/scalekit_sdk_python.egg-info/PKG-INFO +140 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit_sdk_python.egg-info/SOURCES.txt +4 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit_sdk_python.egg-info/requires.txt +5 -5
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/setup.py +6 -6
- scalekit_sdk_python-1.0.0/PKG-INFO +0 -67
- scalekit_sdk_python-1.0.0/README.md +0 -43
- scalekit_sdk_python-1.0.0/scalekit/v1/connections/connections_pb2.py +0 -355
- scalekit_sdk_python-1.0.0/scalekit_sdk_python.egg-info/PKG-INFO +0 -67
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/LICENSE +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/expression_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/expression_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/expression_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/priv/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/priv/private_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/priv/private_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/priv/private_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/validate_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/validate_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/buf/validate/validate_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/common/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/common/user.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/connection.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/constants/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/constants/user.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/domain.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/organization.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/clients/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/clients/clients_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/clients/clients_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/clients/clients_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/commons/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/commons/commons_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/commons/commons_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/commons/commons_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/connections/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/domains/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/environments/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/environments/environments_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/environments/environments_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/environments/environments_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/errdetails/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/errdetails/errdetails_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/errdetails/errdetails_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/errdetails/errdetails_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/events/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/events/events_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/events/events_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/events/events_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/members/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/members/members_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/members/members_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/members/members_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/options/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/options/options_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/options/options_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/options/options_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/organizations/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0/scalekit/v1/users → scalekit_sdk_python-1.0.2/scalekit/v1/user_profile_attributes}/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0/scalekit/v1/workspaces → scalekit_sdk_python-1.0.2/scalekit/v1/users}/__init__.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/users/users_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/users/users_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/users/users_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/workspaces/workspaces_pb2.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/workspaces/workspaces_pb2.pyi +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit/v1/workspaces/workspaces_pb2_grpc.py +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit_sdk_python.egg-info/dependency_links.txt +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/scalekit_sdk_python.egg-info/top_level.txt +0 -0
- {scalekit_sdk_python-1.0.0 → scalekit_sdk_python-1.0.2}/setup.cfg +0 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: scalekit-sdk-python
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: Scalekit official Python SDK
|
|
5
|
+
Home-page: https://github.com/scalekit-inc/scalekit-sdk-python
|
|
6
|
+
Author: Team Scalekit
|
|
7
|
+
Author-email: support@grpc.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: grpcio==1.64.1
|
|
15
|
+
Requires-Dist: protobuf==5.27.0
|
|
16
|
+
Requires-Dist: google==3.0.0
|
|
17
|
+
Requires-Dist: requests==2.32.3
|
|
18
|
+
Requires-Dist: PyJWT==2.8.0
|
|
19
|
+
Requires-Dist: cryptography==42.0.8
|
|
20
|
+
Requires-Dist: setuptools==70.3.0
|
|
21
|
+
Requires-Dist: grpcio-status==1.64.0
|
|
22
|
+
Requires-Dist: protoc-gen-openapiv2==0.0.1
|
|
23
|
+
Requires-Dist: googleapis-common-protos==1.56.1
|
|
24
|
+
|
|
25
|
+
<p align="left">
|
|
26
|
+
<a href="https://scalekit.com" target="_blank" rel="noopener noreferrer">
|
|
27
|
+
<picture>
|
|
28
|
+
<img src="https://cdn.scalekit.cloud/v1/scalekit-logo-dark.svg" height="64">
|
|
29
|
+
</picture>
|
|
30
|
+
</a>
|
|
31
|
+
<br/>
|
|
32
|
+
</p>
|
|
33
|
+
|
|
34
|
+
# Official Python SDK
|
|
35
|
+
<a href="https://scalekit.com" target="_blank" rel="noopener noreferrer">Scalekit</a> is an Enterprise Authentication Platform purpose built for B2B applications. This Python SDK helps implement Enterprise Capabilities like Single Sign-on via SAML or OIDC in your Python applications within a few hours.
|
|
36
|
+
|
|
37
|
+
<div>
|
|
38
|
+
📚 <a target="_blank" href="https://docs.scalekit.com">Documentation</a> - 🚀 <a target="_blank" href="https://docs.scalekit.com">Quick-start Guide</a> - 💻 <a target="_blank" href="https://docs.scalekit.com/apis">API Reference</a>
|
|
39
|
+
</div>
|
|
40
|
+
<hr />
|
|
41
|
+
|
|
42
|
+
## Pre-requisites
|
|
43
|
+
|
|
44
|
+
1. [Sign up](https://scalekit.com) for a Scalekit account.
|
|
45
|
+
2. Get your ```env_url```, ```client_id``` and ```client_secret``` from the Scalekit dashboard.
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
Install Scalekit SDK using your preferred package manager.
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
pip install scalekit-sdk-python
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
```py
|
|
59
|
+
|
|
60
|
+
from scalekit import ScalekitClient
|
|
61
|
+
|
|
62
|
+
sc = ScalekitClient(
|
|
63
|
+
env_url,
|
|
64
|
+
client_id,
|
|
65
|
+
client_secret
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# Use the sc object to interact with the Scalekit API
|
|
69
|
+
auth_url = sc.get_authorization_url(
|
|
70
|
+
"https://acme-corp.com/redirect-uri",
|
|
71
|
+
state="state",
|
|
72
|
+
connection_id="con_123456789"
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Examples - SSO with FastAPI
|
|
78
|
+
|
|
79
|
+
Below is a simple code sample that showcases how to implement Single Sign-on using Scalekit SDK
|
|
80
|
+
|
|
81
|
+
```py
|
|
82
|
+
from fastapi import FastAPI, Request, Response
|
|
83
|
+
from scalekit import ScalekitClient
|
|
84
|
+
import uvicorn
|
|
85
|
+
|
|
86
|
+
app = FastAPI()
|
|
87
|
+
|
|
88
|
+
sc = ScalekitClient(
|
|
89
|
+
env_url,
|
|
90
|
+
client_id,
|
|
91
|
+
client_secret
|
|
92
|
+
)
|
|
93
|
+
|
|
94
|
+
redirect_uri = "http://localhost:8000/auth/callback"
|
|
95
|
+
|
|
96
|
+
@app.get("/auth/login")
|
|
97
|
+
async def auth_login(request: Request):
|
|
98
|
+
auth_url = sc.get_authorization_url(
|
|
99
|
+
redirect_uri,
|
|
100
|
+
state="state",
|
|
101
|
+
connection_id="con_123456789"
|
|
102
|
+
)
|
|
103
|
+
return Response(status_code=302, headers={"Location": auth_url})
|
|
104
|
+
|
|
105
|
+
@app.get("/auth/callback")
|
|
106
|
+
async def auth_callback(request: Request):
|
|
107
|
+
code = request.query_params.get("code")
|
|
108
|
+
token = sc.authenticate_with_code(
|
|
109
|
+
code,
|
|
110
|
+
redirect_uri
|
|
111
|
+
)
|
|
112
|
+
response = JSONResponse(content=token)
|
|
113
|
+
response.set_cookie("access_token", token["access_token"])
|
|
114
|
+
|
|
115
|
+
return response
|
|
116
|
+
|
|
117
|
+
if __name__ == "__main__":
|
|
118
|
+
uvicorn.run(app, port=8080)
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Example Apps
|
|
123
|
+
|
|
124
|
+
Fully functional sample applications written using some popular web application frameworks and Scalekit SDK. Feel free to clone the repo and run them locally.
|
|
125
|
+
|
|
126
|
+
- [FastAPI](https://github.com/scalekit-inc/scalekit-fastapi-example.git)
|
|
127
|
+
|
|
128
|
+
## API Reference
|
|
129
|
+
|
|
130
|
+
Refer to our [API reference docs](https://docs.scalekit.com/apis) for detailed information about all our API endpoints and their usage.
|
|
131
|
+
|
|
132
|
+
## More Information
|
|
133
|
+
|
|
134
|
+
- Quickstart Guide to implement Single Sign-on in your application: [SSO Quickstart Guide](https://docs.scalekit.com)
|
|
135
|
+
- Understand Single Sign-on basics: [SSO Basics](https://docs.scalekit.com/best-practices/single-sign-on)
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
This project is licensed under the **MIT license**.
|
|
140
|
+
See the [LICENSE](LICENSE) file for more information.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<p align="left">
|
|
2
|
+
<a href="https://scalekit.com" target="_blank" rel="noopener noreferrer">
|
|
3
|
+
<picture>
|
|
4
|
+
<img src="https://cdn.scalekit.cloud/v1/scalekit-logo-dark.svg" height="64">
|
|
5
|
+
</picture>
|
|
6
|
+
</a>
|
|
7
|
+
<br/>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
# Official Python SDK
|
|
11
|
+
<a href="https://scalekit.com" target="_blank" rel="noopener noreferrer">Scalekit</a> is an Enterprise Authentication Platform purpose built for B2B applications. This Python SDK helps implement Enterprise Capabilities like Single Sign-on via SAML or OIDC in your Python applications within a few hours.
|
|
12
|
+
|
|
13
|
+
<div>
|
|
14
|
+
📚 <a target="_blank" href="https://docs.scalekit.com">Documentation</a> - 🚀 <a target="_blank" href="https://docs.scalekit.com">Quick-start Guide</a> - 💻 <a target="_blank" href="https://docs.scalekit.com/apis">API Reference</a>
|
|
15
|
+
</div>
|
|
16
|
+
<hr />
|
|
17
|
+
|
|
18
|
+
## Pre-requisites
|
|
19
|
+
|
|
20
|
+
1. [Sign up](https://scalekit.com) for a Scalekit account.
|
|
21
|
+
2. Get your ```env_url```, ```client_id``` and ```client_secret``` from the Scalekit dashboard.
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
Install Scalekit SDK using your preferred package manager.
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pip install scalekit-sdk-python
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```py
|
|
35
|
+
|
|
36
|
+
from scalekit import ScalekitClient
|
|
37
|
+
|
|
38
|
+
sc = ScalekitClient(
|
|
39
|
+
env_url,
|
|
40
|
+
client_id,
|
|
41
|
+
client_secret
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Use the sc object to interact with the Scalekit API
|
|
45
|
+
auth_url = sc.get_authorization_url(
|
|
46
|
+
"https://acme-corp.com/redirect-uri",
|
|
47
|
+
state="state",
|
|
48
|
+
connection_id="con_123456789"
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Examples - SSO with FastAPI
|
|
54
|
+
|
|
55
|
+
Below is a simple code sample that showcases how to implement Single Sign-on using Scalekit SDK
|
|
56
|
+
|
|
57
|
+
```py
|
|
58
|
+
from fastapi import FastAPI, Request, Response
|
|
59
|
+
from scalekit import ScalekitClient
|
|
60
|
+
import uvicorn
|
|
61
|
+
|
|
62
|
+
app = FastAPI()
|
|
63
|
+
|
|
64
|
+
sc = ScalekitClient(
|
|
65
|
+
env_url,
|
|
66
|
+
client_id,
|
|
67
|
+
client_secret
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
redirect_uri = "http://localhost:8000/auth/callback"
|
|
71
|
+
|
|
72
|
+
@app.get("/auth/login")
|
|
73
|
+
async def auth_login(request: Request):
|
|
74
|
+
auth_url = sc.get_authorization_url(
|
|
75
|
+
redirect_uri,
|
|
76
|
+
state="state",
|
|
77
|
+
connection_id="con_123456789"
|
|
78
|
+
)
|
|
79
|
+
return Response(status_code=302, headers={"Location": auth_url})
|
|
80
|
+
|
|
81
|
+
@app.get("/auth/callback")
|
|
82
|
+
async def auth_callback(request: Request):
|
|
83
|
+
code = request.query_params.get("code")
|
|
84
|
+
token = sc.authenticate_with_code(
|
|
85
|
+
code,
|
|
86
|
+
redirect_uri
|
|
87
|
+
)
|
|
88
|
+
response = JSONResponse(content=token)
|
|
89
|
+
response.set_cookie("access_token", token["access_token"])
|
|
90
|
+
|
|
91
|
+
return response
|
|
92
|
+
|
|
93
|
+
if __name__ == "__main__":
|
|
94
|
+
uvicorn.run(app, port=8080)
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Example Apps
|
|
99
|
+
|
|
100
|
+
Fully functional sample applications written using some popular web application frameworks and Scalekit SDK. Feel free to clone the repo and run them locally.
|
|
101
|
+
|
|
102
|
+
- [FastAPI](https://github.com/scalekit-inc/scalekit-fastapi-example.git)
|
|
103
|
+
|
|
104
|
+
## API Reference
|
|
105
|
+
|
|
106
|
+
Refer to our [API reference docs](https://docs.scalekit.com/apis) for detailed information about all our API endpoints and their usage.
|
|
107
|
+
|
|
108
|
+
## More Information
|
|
109
|
+
|
|
110
|
+
- Quickstart Guide to implement Single Sign-on in your application: [SSO Quickstart Guide](https://docs.scalekit.com)
|
|
111
|
+
- Understand Single Sign-on basics: [SSO Basics](https://docs.scalekit.com/best-practices/single-sign-on)
|
|
112
|
+
|
|
113
|
+
## License
|
|
114
|
+
|
|
115
|
+
This project is licensed under the **MIT license**.
|
|
116
|
+
See the [LICENSE](LICENSE) file for more information.
|
|
@@ -59,8 +59,7 @@ class ScalekitClient:
|
|
|
59
59
|
scopes = (
|
|
60
60
|
options.scopes if options.scopes else ["openid", "profile", "email"]
|
|
61
61
|
)
|
|
62
|
-
|
|
63
|
-
{
|
|
62
|
+
url_params_dict = {
|
|
64
63
|
"response_type": "code",
|
|
65
64
|
"client_id": self.core_client.client_id,
|
|
66
65
|
"redirect_uri": redirect_uri,
|
|
@@ -71,8 +70,11 @@ class ScalekitClient:
|
|
|
71
70
|
"domain_hint": options.domain_hint,
|
|
72
71
|
"connection_id": options.connection_id,
|
|
73
72
|
"organization_id": options.organization_id,
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
"provider": options.provider,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
valid_auth_params = {k: v for k, v in url_params_dict.items() if v}
|
|
77
|
+
query_string = urlencode(valid_auth_params)
|
|
76
78
|
|
|
77
79
|
return f"{self.core_client.env_url}/{AUTHORIZE_ENDPOINT}?{query_string}"
|
|
78
80
|
except Exception as exp:
|
|
@@ -25,7 +25,7 @@ class WithCall(Protocol):
|
|
|
25
25
|
class CoreClient:
|
|
26
26
|
"""Class definition for Core Client"""
|
|
27
27
|
|
|
28
|
-
sdk_version = "Scalekit-Python/0.
|
|
28
|
+
sdk_version = "Scalekit-Python/1.0.2"
|
|
29
29
|
api_version = "20240430"
|
|
30
30
|
user_agent = f"{sdk_version} Python/{platform.python_version()} ({platform.system()}; {platform.architecture()}"
|
|
31
31
|
|