Skip to main content

GeneXus Access Manager (GAM) client for OAuth authentication

Project description

pygeai-gam - GeneXus Access Manager Client

Standalone OAuth client for GeneXus Access Manager (GAM) with support for multiple grant types including PKCE.

[!WARNING] This project is in Alpha stage and it's NOT suitable for production yet. While you can install the package and try it out, it's recommended to avoid using it in production until version 1.0.0 is released

Features

  • Multiple OAuth Grant Types:

    • Password Grant (Resource Owner Password Credentials)
    • Authorization Code Grant
    • Authorization Code with PKCE (Proof Key for Code Exchange)
  • Secure OAuth Flow:

    • Built-in callback server for authorization code flow
    • PKCE support for enhanced security
    • Token management and refresh
  • CLI Support:

    • Interactive token acquisition
    • Configuration management
    • Multiple authentication workflows

Installation

pip install pygeai-gam

Quick Start

Password Grant Flow

from pygeai_gam import GAMClient

client = GAMClient(
    base_url="https://your-gam-server.com",
    client_id="your_client_id",
    client_secret="your_client_secret"
)

token = client.get_access_token_password_grant(
    username="user@example.com",
    password="your_password"
)

print(f"Access Token: {token['access_token']}")

Authorization Code Flow with PKCE

from pygeai_gam import GAMClient

client = GAMClient(
    base_url="https://your-gam-server.com",
    client_id="your_client_id",
    use_pkce=True
)

token = client.get_access_token_authorization_code(
    redirect_uri="http://localhost:8080/callback",
    scope="openid profile email"
)

print(f"Access Token: {token['access_token']}")

Migration from pygeai.gam

If you were using GAM from the pygeai package, update your imports:

# Before
from pygeai.gam.clients import GAMClient
from pygeai.gam.endpoints import GAM_ENDPOINTS

# After
from pygeai_gam import GAMClient
from pygeai_gam.endpoints import GAM_ENDPOINTS

Update your dependencies:

# Before
pip install pygeai

# After
pip install pygeai-gam

Automated Migration

Use the migration script to update your codebase:

# Install pygeai with migration tools
pip install pygeai>=0.7.0

# Run migration script
migrate-pygeai-gam /path/to/your/project

# Preview changes without modifying files
migrate-pygeai-gam /path/to/your/project --dry-run

CLI Usage

# Get access token using password grant
gam-cli token password \
  --base-url https://your-gam-server.com \
  --client-id your_client_id \
  --client-secret your_client_secret \
  --username user@example.com \
  --password your_password

# Get access token using authorization code with PKCE
gam-cli token auth-code \
  --base-url https://your-gam-server.com \
  --client-id your_client_id \
  --redirect-uri http://localhost:8080/callback \
  --use-pkce

Documentation

Full documentation is available in the docs/ directory.

Development

# Navigate to package directory
cd pygeai-gam

# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run linter
ruff check .

# Format code
black .

Requirements

  • Python >= 3.10
  • requests >= 2.31.0
  • pydantic >= 2.11.3

License

MIT License - See LICENSE file for details

Bugs and Suggestions

To report any bug, request features or make any suggestions, the following email is available:

geai-sdk@globant.com

Terms and Conditions

By using this package, you agree to the Globant Enterprise AI Terms of Use.

Authors

Copyright 2025, Globant. All rights reserved

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygeai_gam-0.1.0b2.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pygeai_gam-0.1.0b2-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file pygeai_gam-0.1.0b2.tar.gz.

File metadata

  • Download URL: pygeai_gam-0.1.0b2.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pygeai_gam-0.1.0b2.tar.gz
Algorithm Hash digest
SHA256 386ee1375b88dd75b879cec958ec276adc5e912f5aeadbaefc6e864da67d6307
MD5 1fbd7b9090c5a9ef131f428883c4ca49
BLAKE2b-256 c98eed7b26e02e435223eef71ca2fe3333fea77ea657c3bad1719fd8662156e5

See more details on using hashes here.

File details

Details for the file pygeai_gam-0.1.0b2-py3-none-any.whl.

File metadata

  • Download URL: pygeai_gam-0.1.0b2-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pygeai_gam-0.1.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 dfae8a5529b8319118fd54ebab7553c3bfd3bb106185f6c462e90858d509ae35
MD5 b6e51315e846d37f6e15e8994d467832
BLAKE2b-256 cac596e92e09f4e5761f892ab44057d3426d7267176c267b41232378f9fda521

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page