Skip to content

Feature/jwt implementation#2

Open
tahah02 wants to merge 2 commits into
masterfrom
feature/jwt-implementation
Open

Feature/jwt implementation#2
tahah02 wants to merge 2 commits into
masterfrom
feature/jwt-implementation

Conversation

@tahah02
Copy link
Copy Markdown
Owner

@tahah02 tahah02 commented Nov 21, 2025

🚀 Feature Implementation: Security, Logging & Frontend Integration
This Pull Request introduces a comprehensive security layer, advanced audit logging, and a functional frontend client to the EasyPay Fintech API.

🔐 1. Security & Authentication (Major Upgrade)
JWT Authentication: Implemented a secure Login API that issues JSON Web Tokens.

Authorization Lock: Protected the core Transfer API using the [Authorize] attribute.

Password Hashing: Integrated SHA256 hashing to securely store user passwords in the database.

Identity Handling: Updated middleware to extract UserId securely from the JWT token claims instead of the request body.

📊 2. Monitoring & Auditing
Logging Middleware: Created a custom middleware to capture Request/Response bodies and Client Headers (IP, DeviceID) into the ApiLogs table.

Database Tracking: Ensured all transactions are logged with a unique LogId and detailed audit trail (Opening/Closing balances).

💻 3. Frontend Integration
Web Client: Added a lightweight index.html client for testing.

State Management: Implemented local storage handling for JWT tokens and auto-logout on token expiry.

CORS Policy: Configured backend to allow secure cross-origin requests.

🛠 Technical Changes
Refactored Program.cs to support JWT Bearer authentication.

Updated TransactionManager to handle password verification and token generation.

Cleaned up appsettings.json configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant