Skip to main content

Kerliix OAuth Python SDK

Official Kerliix OAuth 2.0 SDK for Python

PyPI version License: MIT


Overview

Kerliix OAuth Python SDK provides a simple and secure way to integrate Kerliix authentication into your Python applications. It handles the full OAuth 2.0 flow including:

  • Generating authorization URLs
  • Exchanging authorization codes for tokens
  • Token caching and auto-refresh
  • Fetching user profile data
  • Revoking tokens

Installation

pip install kerliix-oauth

Quick Start

from kerliix_oauth import KerliixOAuth

client = KerliixOAuth(
    client_id="YOUR_CLIENT_ID",
    client_secret="YOUR_CLIENT_SECRET",
    redirect_uri="http://localhost:5175/callback",
    base_url="http://localhost:4000"
)

# Step 1: Generate auth URL
print("Login at:", client.get_auth_url())

# Step 2: Exchange code for tokens
# code = input("Enter code from redirect URL: ")
# tokens = client.exchange_code_for_token(code)
# print("Tokens:", tokens)

# Step 3: Fetch user info
# user = client.get_user_info(tokens.access_token)
# print("User:", user)

Configuration Options

Option Required Description
client_id ✅ Your app’s client ID from Kerliix developer portal
client_secret ⚙️ Required for server-side (authorization code flow)
redirect_uri ✅ The callback URI registered in your app
base_url ✅ Your Kerliix OAuth server URL

OAuth Flow

  1. User clicks login → Redirect to Kerliix via get_auth_url()
  2. Kerliix authenticates → Redirects back with ?code=XYZ
  3. Your app exchanges code → exchange_code_for_token(code)
  4. Use token → Access user data via get_user_info()
  5. Optional → Automatically refresh expired tokens using refresh_token_if_needed()

API Reference

KerliixOAuth Class

client = KerliixOAuth(client_id, client_secret, redirect_uri, base_url)

get_auth_url(scopes=None, state="")

Generates an OAuth authorization URL.

exchange_code_for_token(code)

Exchanges an authorization code for access and refresh tokens.

refresh_token_if_needed()

Refreshes the access token if it is expired or near expiry.

get_user_info(access_token=None)

Fetches user profile data. Uses cached token if access_token is not provided.

revoke_token(token)

Revokes an access or refresh token and clears cache.


Token Caching

  • Tokens are cached in memory with automatic refresh 30 seconds before expiry.
  • Works seamlessly for long-running Python applications.

License

MIT © Kerliix Corporation

Metadata

Release files for kerliix-oauth 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kerliix-oauth 1.0.2
File Size Uploaded
kerliix_oauth-1.0.2.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kerliix-oauth 1.0.2
File Interpreter ABI Platform
kerliix_oauth-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / kerliix_oauth-1.0.2.tar.gz

Download URL kerliix_oauth-1.0.2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
13b94e762b1f7b70ef824584831301855a938435fd26f46377683130d5696936
BLAKE2b-256 checksum
How to use checksums
f96e505f68a734a6bd140e601c38cf77d548eb43604ec6f5fbbf73567daac782
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / kerliix_oauth-1.0.2-py3-none-any.whl

Download URL kerliix_oauth-1.0.2-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae6dbf564a717e7a8e7a9ea3fdff11e1640192db62c1cca4af037f498dae0e7f
BLAKE2b-256 checksum
How to use checksums
1e122f9232672a9be5e3f6d8f4cc0915697277c62b959f56bf1701ee25a3e99d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page