Skip to main content

This helps you setup MFA with 3rd Party Authenticator (Google Authenticator, Microsoft Authenticator, etc)

Project description

MFA SETUP AND VERIFICATION PACKAGE

This is a python package for MFA setup and verification using 3rd Party

Authenticating Applications (like Google Authenticator, Microsoft Authenticator,Sale Force, etc)

Setup MFA: Onboard on a 3rd Party Authenticator Application:

1. Generate the MFA URL AND SECRET KEY
2. Generate the QR Code version of the MFA URL
3. Integrate with the 3rd party Authenticator :
        a. Scan the QR code generated
        b. Enter the Secret Key

MFA Verification:

-   Insert the code and verify it

Sample Code:

from mfa import MFA


1. Generate the MFA URL AND SECRET KEY
    m = MFA(service_name, user_details)
        => service_name is the name of the service (eg: company name) : STRING
        => user_detail is the user details (eg: email address, phone number, etc):  STRING
    
    Example: 
        service_name = 'Sunny Inc'
        user_details = 'sunday@test.com'
        m = MFA(service_name, user_details) 
        mfa_url,secret_key = m.generate_mfa_code()
        print(mfa_url)
        print(secret_key)

2. Generate the QR Code version of the MFA URL
    m.generate_qr_code(mfa_url)   
   
    ##### NOTE: This is optional because the mfa_url should be converted to a qr code on the 
                client side ( Fromtend application : Web or Mobile App)
  


3. Verify the Generated Code
    generated_code = '123456' # generated by the user via the 
                                # 3rd party authenticator app (Google Authenticator, Microsoft Authenticator, etc)
    
    status = m.verify_code(generated_code)
    print(status)

NOTE:

1 -> Developer will be expected to save the secret Key for each user 
    (it should be unique for each user)
        
2 -> End User should be asked to save the secret key or I will suggest 
    you save it in a db with a key value pair or a field where the key 
    is the recovery code (unique) and value is the secret key. So you share 
    the recovery code with the user

3 -> When they can't recover the qr or lost the mobile device, 
    you can ask them for the recovery code then use it to get the secret key 
    from the db and then use it to setup on the 3rd party authenticator app.

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

mfa_authenticator-1.0.4.9.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

mfa_authenticator-1.0.4.9-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

Details for the file mfa_authenticator-1.0.4.9.tar.gz.

File metadata

  • Download URL: mfa_authenticator-1.0.4.9.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for mfa_authenticator-1.0.4.9.tar.gz
Algorithm Hash digest
SHA256 b66965f8f862ff8d861cc78f1d53f73f87e5715f43712cf3bf8a4aa82358a3aa
MD5 b99a5381e311b43d1cc696c287c8296c
BLAKE2b-256 b780d6b137c4f886387bc9fd4763878423f2273d4c335dbeb7636aa47f9bdd50

See more details on using hashes here.

File details

Details for the file mfa_authenticator-1.0.4.9-py3-none-any.whl.

File metadata

File hashes

Hashes for mfa_authenticator-1.0.4.9-py3-none-any.whl
Algorithm Hash digest
SHA256 7235c87bf50e9221d7c7756d49d1d32aefeb1beb483efbce20b622106ebc5e4a
MD5 98a0d838be6d350112a765a0f5697b0a
BLAKE2b-256 82009ecb3bb74d9943abd31e0735974d8c7c57d3ac37d7ac33193318dfa593e6

See more details on using hashes here.

Supported by

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