Skip to main content

Arvasit Authentication SDK for Python

Project description

Arvasit Authentication SDK for Python

This is the Python SDK for Arvasit Authentication service. It provides a simple interface to interact with the Arvasit Authentication API.

Installation

pip install arvasit-auth-sdk

Usage

from auth_sdk import AuthService, AuthServiceConfig

# Initialize the auth service
config = AuthServiceConfig(
    url="https://api.arvasit.com",
    public_key="your_public_key",
    secret_key="your_secret_key"
)
auth_service = AuthService(config)

# Signup a new user
signup_response = auth_service.signup({
    "email": "user@example.com",
    "password": "secure_password",
    "firstName": "John",
    "lastName": "Doe"
})

# Login with password
login_response = auth_service.login_with_password({
    "credential": "user@example.com",
    "password": "secure_password"
})

# Send OTP for login
otp_response = auth_service.send_otp_for_login("user@example.com")

# Login with OTP
login_with_otp_response = auth_service.login_with_otp({
    "credential": "user@example.com",
    "otp": "123456"
})

# Verify 2FA
verify_2fa_response = auth_service.verify_two_factor_authentication({
    "credential": "user@example.com",
    "totp": "123456"
})

# Generate recovery codes
recovery_codes = auth_service.generate_recovery_codes("access_token")

# Generate QR code for 2FA
qr_code_response = auth_service.generate_qr_code_and_secret_for_2fa("access_token")

# List 2FA secrets
secrets = auth_service.list_of_two_fa_secrets("access_token")

# Remove 2FA device
removed_secrets = auth_service.remove_two_fa_device("access_token", "secret_key")

# Disable 2FA
disabled = auth_service.disable_two_fa("access_token")

# List recovery codes
recovery_codes = auth_service.list_of_recovery_code("access_token")

# Logout
logout_response = auth_service.logout({"accessToken": "access_token"})

# Refresh access token
refresh_response = auth_service.refresh_access_token({"refreshToken": "refresh_token"})

Features

  • User authentication (signup, login)
  • Two-factor authentication (2FA)
  • OTP-based authentication
  • Recovery codes
  • Session management
  • Token refresh
  • Error handling

Requirements

  • Python 3.8 or higher
  • requests>=2.31.0
  • python-dateutil>=2.8.2
  • pydantic>=2.0.0

License

MIT

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

arvasit_auth_sdk-0.1.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

arvasit_auth_sdk-0.1.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file arvasit_auth_sdk-0.1.1.tar.gz.

File metadata

  • Download URL: arvasit_auth_sdk-0.1.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for arvasit_auth_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8490d0a27e8a1a2cf30bb27879bc1ef9893fae0e5c8f7d89c24c141f31d75b4c
MD5 cac1c36379edfa317b6f01ccaf92a5eb
BLAKE2b-256 00e2ba393469655c9fd4d2af5788e20286e085dfecdcc2d83eff00e2cbe23262

See more details on using hashes here.

File details

Details for the file arvasit_auth_sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for arvasit_auth_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 58fae6c238c713dfd91ff17fa5671f19aafad42df78a0e56d9307910e97154cf
MD5 f9d09f413f5b42b94a2c3210de583f9d
BLAKE2b-256 9483cf5be9fa9c77afc074764e4a925acf484669bad242cda0d40692985b59cf

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