Authentication system using Evrmore blockchain signatures
Project description
Evrmore Authentication
A secure wallet-based authentication system for Evrmore blockchain applications
๐ Table of Contents
- โจ Overview
- ๐ Quick Start
- ๐งฐ System Requirements
- ๐ Authentication Flow
- ๐ Usage in Your Application
- โ๏ธ Configuration
- ๐ Documentation
- ๐ป Development
- ๐ License
- ๐ Contact
โจ Overview
Evrmore Authentication is a Python package that provides wallet-based authentication using Evrmore signature verification. This allows users to authenticate to web applications using their Evrmore wallet without sharing their private keys, creating a secure and user-friendly authentication experience.
Key Features:
- ๐ Wallet-based authentication - Users sign a challenge message with their Evrmore wallet
- ๐ JWT token management - Secure session handling with JSON Web Tokens
- ๐ SQLite backend - Simple, file-based database for session and challenge storage
- ๐ค Automatic user management - Users are created on first authentication
- ๐ Complete API server - Ready-to-use FastAPI server for authentication endpoints
- ๐ฅ๏ธ Demo web interface - Example Flask application showing the complete authentication flow
๐ Quick Start
Installation
pip3 install evrmore-authentication
Running the API Server
python3 -m scripts.run_api_server --host 0.0.0.0 --port 8000
Running the Web Demo
python3 -m scripts.run_web_demo --port 5000 --api-url http://localhost:8000
๐งฐ System Requirements
- Python 3.7 or higher
- SQLite database for session and challenge storage
- Evrmore node (for signature verification)
๐ Authentication Flow
| 1. Challenge Generation | The server generates a unique challenge for the user's Evrmore address |
| 2. Signature Creation | The user signs the challenge with their Evrmore wallet |
| 3. Verification | The server verifies the signature against the challenge |
| 4. Token Issuance | Upon successful verification, a JWT token is issued |
| 5. Authentication | The token is used for subsequent API requests |
๐ Usage in Your Application
Basic Authentication Flow
from evrmore_authentication import EvrmoreAuth
from evrmore_rpc import EvrmoreClient
# Initialize the authentication system with an Evrmore client
client = EvrmoreClient()
auth = EvrmoreAuth(client)
# Generate a challenge for a user's Evrmore address
challenge = auth.generate_challenge("EXaMPLeEvRMoReAddResS")
# Verify the signature provided by the user
session = auth.authenticate(
evrmore_address="EXaMPLeEvRMoReAddResS",
challenge=challenge,
signature="signed_challenge_from_wallet"
)
# Use the token for authentication
token = session.token
# Validate a token
token_data = auth.validate_token(token)
# Get user from token
user = auth.get_user_by_token(token)
# Invalidate a token (logout)
auth.invalidate_token(token)
FastAPI Integration
The package includes a ready-to-use FastAPI server with the following endpoints:
| Endpoint | Method | Description |
|---|---|---|
/challenge |
POST | Generate a challenge for a user |
/authenticate |
POST | Authenticate with a signed challenge |
/validate |
GET | Validate a JWT token |
/me |
GET | Get authenticated user information |
/logout |
POST | Invalidate a JWT token (logout) |
โ๏ธ Configuration
Configuration is done through environment variables or a .env file:
# SQLite configuration
SQLITE_DB_PATH=./data/evrmore_auth.db
# JWT configuration
JWT_SECRET=your-secure-secret-key
JWT_ALGORITHM=HS256
JWT_ACCESS_TOKEN_EXPIRE_MINUTES=30
# Challenge configuration
CHALLENGE_EXPIRE_MINUTES=10
๐ Documentation
For more information, please see:
๐ป Development
Project Structure
evrmore-authentication/
โโโ evrmore_authentication/ # Main package
โ โโโ __init__.py # Package initialization
โ โโโ auth.py # Core authentication logic
โ โโโ api.py # FastAPI endpoints
โ โโโ models.py # Database models
โ โโโ exceptions.py # Custom exceptions
โ โโโ dependencies.py # FastAPI dependencies
โโโ scripts/ # Utility scripts
โ โโโ run_api_server.py # API server runner
โ โโโ run_web_demo.py # Web demo runner
โโโ examples/ # Example applications
โ โโโ demo.py # Simple CLI demo
โ โโโ web_auth_demo/ # Web application example
โโโ tests/ # Test suite
โโโ docs/ # Documentation
โโโ setup.py # Package setup
Setup Development Environment
git clone https://github.com/manticoretechnologies/evrmore-authentication.git
cd evrmore-authentication
pip3 install -e .
Running Tests
pytest
Building Documentation Locally
# Install MkDocs and the Material theme
pip3 install mkdocs-material
# Serve the documentation locally at http://127.0.0.1:8000
mkdocs serve
# Build the documentation
mkdocs build
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Contact
| ๐ข Organization | Manticore Technologies |
| ๐ Website | manticore.technology |
| ๐ GitHub | github.com/manticoretechnologies |
| โ๏ธ Email | dev@manticore.technology |
Built with โค๏ธ by Manticore Technologies
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file evrmore_authentication-0.3.0.tar.gz.
File metadata
- Download URL: evrmore_authentication-0.3.0.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
353cafe2130fdfad2b54df60601a9090102571277e621b241522917dce916684
|
|
| MD5 |
37d2c94142fbdbb1a618d1a936dfbdf0
|
|
| BLAKE2b-256 |
db9bb0994bab7c3c8347379313923aa5fb20800788e858a01d3bf379659218d4
|
File details
Details for the file evrmore_authentication-0.3.0-py3-none-any.whl.
File metadata
- Download URL: evrmore_authentication-0.3.0-py3-none-any.whl
- Upload date:
- Size: 27.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8216b0ca6e2174ab634e03e35c1ae518504d486af5ef66ca07f74555137aa95a
|
|
| MD5 |
6f3e834a905c09c7ddd8c670c61e07e7
|
|
| BLAKE2b-256 |
dddfbbcc80e2e6c605bb9fa31690afc8ccb326e9c3e5e0562d07b8eef2a27567
|