This helps you setup MFA with 3rd Party Authenticator
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:
1. 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_details is the user details (eg: email address, phone number, etc): STRING
Example:
m = MFA('Sunny Inc','sunday@test.com')
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)
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 the secret Key for the use ( 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 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 then use it to setup on the 3rd party authenticator app.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mfa_authenticator-1.0.1.tar.gz
.
File metadata
- Download URL: mfa_authenticator-1.0.1.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d44f70ebf3f53c34ecd5ef28427236fa0cf8dc38e480a9aa83d7c827c2e86c9 |
|
MD5 | aa95050a177b203eedf9552afd08c75c |
|
BLAKE2b-256 | a2045d65f4f4aa1740fcceee1b5b2cd6286b66d3a8ffb318e8554bc9e89942ce |
File details
Details for the file mfa_authenticator-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: mfa_authenticator-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 607785a4109a65b39584d429ff0117db256db208f1e23435e2b7f59f810d85ee |
|
MD5 | cfa814fe7c93501907935561fcf4c266 |
|
BLAKE2b-256 | 0ed35cadee47968a1e0c5dfce6febc69207be9cddcbf907fa5d939ddb068c8e0 |