Skip to main content

Client library for Purple Auth

Project description

Purple Auth Client

An async python client for my "Purple Auth" microservice.

Routes Covered

initialization

from purple_auth_client import AuthClient

auth_client = AuthClient(
    host="https://purpleauth.com",
    app_id="37f9a26d-03c8-4b7c-86ad-132bb82e8e38",
    api_key="[Key provided by purple auth portal]"
)

/otp/request/

Start otp authentication flow with server.

result = await auth_client.authenticate(
    "test@example.com", flow="otp"
)

/otp/confirm/

Complete authentication with email and generated code.

result = await auth_client.submit_code("test@example.com", "12345678")

/token/verify/

Send idToken to server for verification.

result = await auth_client.verify_token_remote(token_submitted_by_client)

/token/refresh/

Request a new ID Token from the server using a refresh token

new_token = await auth_client.refresh(refresh_token_from_client)

/app/

Get more info about this app from the server.

info = await auth_client.app_info()

/magic/request/

Start authentication using magic link flow.

result = await auth_client.authenticate(
    "test@example.com", flow="magic"
)

Local Verification

Verify and decode an ID Token on directly in the app without having to call out every time

result = await auth_client.verify(id_token_from_client)
# {"headers": {"alg": "ES256", "type": "JWT"}, "claims": {"sub": "user@email.com", "exp": "test@example.com"}
# etc.

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

purple-auth-client-1.0.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

purple_auth_client-1.0.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file purple-auth-client-1.0.2.tar.gz.

File metadata

  • Download URL: purple-auth-client-1.0.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.14 Darwin/21.6.0

File hashes

Hashes for purple-auth-client-1.0.2.tar.gz
Algorithm Hash digest
SHA256 4092b0b731b958c7942c3d26de1ed0ce93096225b8e15803368f924f733b6f35
MD5 6a34a0afc6bb1a48c60e9bef1030390b
BLAKE2b-256 65ed48584d0a7af93722befa0fae835b415a0ded053e45dbd22431f01e533b1d

See more details on using hashes here.

File details

Details for the file purple_auth_client-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: purple_auth_client-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.9.14 Darwin/21.6.0

File hashes

Hashes for purple_auth_client-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6655ab77837eee0f5990f2658433600696b54796c3979df1a071b8e4c5a3b0b7
MD5 c3662ceb7fb44af3610086ef88c95a10
BLAKE2b-256 f4b536c0e12839aba76ef4db5f46604e57d52e1ed89989bc5ce3e92f21f40c0f

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