Scalekit official Python SDK
Project description
Official Python SDK
Scalekit 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.
Pre-requisites
- Sign up for a Scalekit account.
- Get your
env_url,client_idandclient_secretfrom the Scalekit dashboard.
Installation
Install Scalekit SDK using your preferred package manager.
pip install scalekit-sdk-python
Usage
from scalekit import ScalekitClient
sc = ScalekitClient(
env_url,
client_id,
client_secret
)
# Use the sc object to interact with the Scalekit API
auth_url = sc.get_authorization_url(
"https://acme-corp.com/redirect-uri",
state="state",
connection_id="con_123456789"
)
Minimum Requirements
To use the Scalekit Python SDK, you must have the following:
| Component | Version |
|---|---|
| Python | 3.8+ |
Tip: Although Python 3.8 meets the minimum requirement, using a more recent version (such as Python 3.9 or later) is advisable.
Examples - SSO with FastAPI
Below is a simple code sample that showcases how to implement Single Sign-on using Scalekit SDK
from fastapi import FastAPI, Request, Response
from scalekit import ScalekitClient
import uvicorn
app = FastAPI()
sc = ScalekitClient(
env_url,
client_id,
client_secret
)
redirect_uri = "http://localhost:8000/auth/callback"
@app.get("/auth/login")
async def auth_login(request: Request):
auth_url = sc.get_authorization_url(
redirect_uri,
state="state",
connection_id="con_123456789"
)
return Response(status_code=302, headers={"Location": auth_url})
@app.get("/auth/callback")
async def auth_callback(request: Request):
code = request.query_params.get("code")
token = sc.authenticate_with_code(
code,
redirect_uri
)
response = JSONResponse(content=token)
response.set_cookie("access_token", token["access_token"])
return response
if __name__ == "__main__":
uvicorn.run(app, port=8080)
Example Apps
Fully functional sample applications written using some popular web application frameworks and Scalekit SDK. Feel free to clone the repo and run them locally.
API Reference
Refer to our API reference docs for detailed information about all our API endpoints and their usage.
More Information
- Quickstart Guide to implement Single Sign-on in your application: SSO Quickstart Guide
- Understand Single Sign-on basics: SSO Basics
License
This project is licensed under the MIT license. See the LICENSE file for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file a_beta_scalekit-2.3.1b1.tar.gz.
File metadata
- Download URL: a_beta_scalekit-2.3.1b1.tar.gz
- Upload date:
- Size: 286.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c19ed74b9cb3d15b5f29892550815718b1760df20c818bf7b6f14b18a171703
|
|
| MD5 |
8045a9ac0448ee215f26a9b9770c000f
|
|
| BLAKE2b-256 |
41255290f7d1966df67c3462a5830ef33b3c6145336b1e4b057d04af3fe3ac6c
|
Provenance
The following attestation bundles were made for a_beta_scalekit-2.3.1b1.tar.gz:
Publisher:
python-publish.yml on Avinash-Kamath/scalekit-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a_beta_scalekit-2.3.1b1.tar.gz -
Subject digest:
9c19ed74b9cb3d15b5f29892550815718b1760df20c818bf7b6f14b18a171703 - Sigstore transparency entry: 344754340
- Sigstore integration time:
-
Permalink:
Avinash-Kamath/scalekit-sdk-python@917632ef2eac31c00ced9910190b6de0cf19e44d -
Branch / Tag:
refs/tags/2.3.1b1 - Owner: https://github.com/Avinash-Kamath
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@917632ef2eac31c00ced9910190b6de0cf19e44d -
Trigger Event:
release
-
Statement type:
File details
Details for the file a_beta_scalekit-2.3.1b1-py3-none-any.whl.
File metadata
- Download URL: a_beta_scalekit-2.3.1b1-py3-none-any.whl
- Upload date:
- Size: 316.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3767faf1810eb68c83748e176f8cfcd88f371bb49cea182bb8d7da66589e110c
|
|
| MD5 |
4c79e136639c82c192495da7c1001206
|
|
| BLAKE2b-256 |
67c5d6b494440b293162eb7c2cdd358b1979290661b842e18df63f458848e904
|
Provenance
The following attestation bundles were made for a_beta_scalekit-2.3.1b1-py3-none-any.whl:
Publisher:
python-publish.yml on Avinash-Kamath/scalekit-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a_beta_scalekit-2.3.1b1-py3-none-any.whl -
Subject digest:
3767faf1810eb68c83748e176f8cfcd88f371bb49cea182bb8d7da66589e110c - Sigstore transparency entry: 344754371
- Sigstore integration time:
-
Permalink:
Avinash-Kamath/scalekit-sdk-python@917632ef2eac31c00ced9910190b6de0cf19e44d -
Branch / Tag:
refs/tags/2.3.1b1 - Owner: https://github.com/Avinash-Kamath
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@917632ef2eac31c00ced9910190b6de0cf19e44d -
Trigger Event:
release
-
Statement type: