Feature/jwt implementation#2
Open
tahah02 wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 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.