Skip to main content

IraAuthM2M authenticates an application by IraAuth so that it can access APIs protected by IraAuth

Project description

IraAuthM2M client

IraAuthM2M (machine-to-machine authentication) is used to authenticate an application by IraAuth so that it can access APIs protected by IraAuth.

Install

pip install ira_auth_m2m_client

Sample Usage

import os
import asyncio
from ira_auth_m2m.auth import IraAuth


ira_auth = IraAuth(
    client_id=os.environ.get("IRA_AUTH_M2M_CLIENT_ID"), 
    client_secret=os.environ.get("IRA_AUTH_M2M_CLIENT_SECRET"),
    token_endpoint=os.environ.get("IRA_AUTH_M2M_TOKEN_ENDPOINT"),
    cookie_name=os.environ.get("IRA_AUTH_M2M_COOKIE_NAME")
)


http = ira_auth.get_http_client(base_path="https://xyz.com")


async def main():
    response = await http("GET", "/animals/dog/husky/info")
    if response != None:
        print(response.json())
    
    await ira_auth.cleanup()


asyncio.run(main())

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

ira_auth_m2m_client-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file ira_auth_m2m_client-0.1.0.tar.gz.

File metadata

  • Download URL: ira_auth_m2m_client-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for ira_auth_m2m_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b0cfc29a3f1b928207387e659992b482336f46ae17c40b8e2286381bc3a867e
MD5 578d9564454891ad7b470e4af1ef1c17
BLAKE2b-256 4b13a10eeb851a70dfc7e05b46b3338a22ad34e58f5f8797868be4244c2d19cf

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