Skip to main content

A package for generating and authenticating OTPs using MongoDB.

Project description

AuthoRex

AuthoRex is a Python package for generating and authenticating OTPs (One-Time Passwords) using MongoDB for storage. This package is useful for applications that require secure OTP-based authentication.

Features

  • Generate OTPs for given phone numbers.
  • Authenticate OTPs for given phone numbers.
  • Uses MongoDB for storing OTPs securely.

Installation

You can install AuthoRex using pip:

pip install AuthoRex

Usage

Importing the package

You can import the entire package or specific functions:

import AuthoRex

# Or import specific functions
from AuthoRex import genOTP, authOTP

Generating an OTP

Generate an OTP for a given phone number:

# Using the package import
print(AuthoRex.genOTP("1234567890"))

# Using the function import
print(genOTP("1234567890"))

Authenticating an OTP

Authenticate an OTP for a given phone number:

# Using the package import
print(AuthoRex.authOTP("1234567890", 123456))  # Replace 123456 with the actual OTP generated

# Using the function import
print(authOTP("1234567890", 123456))  # Replace 123456 with the actual OTP generated

Example

Here's a complete example of how to use AuthoRex:

import AuthoRex

# Generate OTP for a phone number
response = AuthoRex.genOTP("1234567890")
print(response)

# Authenticate OTP for the same phone number
is_authenticated = AuthoRex.authOTP("1234567890", 123456)  # Replace 123456 with the actual OTP generated
print("Authenticated" if is_authenticated else "Authentication Failed")

MongoDB Configuration

AuthoRex uses MongoDB to store OTPs. Make sure you have a MongoDB instance running and update the MongoDB URI in the code as per your setup.

License

This project is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. See the LICENSE file for more details.

Author

AuthoRex is developed and maintained by TraxDinosaur. For any queries or support, you can reach out to TraxDinosaur.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.

Acknowledgements

  • The package uses pymongo for MongoDB interactions.

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

authorex-1.0.0.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.

AuthoRex-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file authorex-1.0.0.tar.gz.

File metadata

  • Download URL: authorex-1.0.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for authorex-1.0.0.tar.gz
Algorithm Hash digest
SHA256 054a026e1be36e84b8b178a63afcfedf630336134db810afa8038407532fa1c8
MD5 3fdac26ab5a6ef8ec955c8893af7bbb8
BLAKE2b-256 bd90841283fe4e9c6265f15017a20ab128b7ff442f6913962da229c143f567d7

See more details on using hashes here.

File details

Details for the file AuthoRex-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: AuthoRex-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for AuthoRex-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd5f719974a7934f337c4e21bf911d8a9173c8269fa00131fdb8ab57f750e8be
MD5 7b44ccf56fb43217594ca5ee157bef4f
BLAKE2b-256 90e81573d4a7e6e4b0d9e7b200b0d60acb18f725988b894e311cd9d198d897e3

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