As Promised that After each week I would document the progress that I have had with the challenges that I have faced. So Lets Dig IN.
Getting Started
Last week, I focused on building the authentication system for my FarmFluent platform. I started by setting up the project structure using Onion Architecture, which helped me organize my code better and maintain a clean separation of concerns. For my database, I chose PostgreSQL.
Initial Setup
I began by initializing the application and implementing MediatR to handle my commands and queries efficiently. This choice made it easier to manage the different authentication flows I needed to build.
Authentication Implementation
My main focus was on creating a multi-role authentication system that would work for all my users. I implemented three distinct roles:
Farmers
Agricultural Experts
System Administrators
One of my key decisions was implementing different authentication requirements for each role. For farmers, I created a simplified authentication system using a four-digit PIN. I made this choice because many of our farmer users have varying levels of digital literacy, I wanted to ensure they could easily access the system without compromising basic security.
For experts and administrators, I implemented more stringent authentication requirements since they have access to sensitive system features and data.
Authentication Features
I successfully implemented several key features:
User signup and login using Microsoft Identity with a custom user model
Role-based authentication with different security levels
Google signup integration for additional login options
JWT implementation for secure token-based authentication
Making Authentication More Accessible
For farmers specifically, I focused on making the authentication process as straightforward as possible. The four-digit PIN system works well for basic access, while still maintaining security through:
Limited login attempts
Account lockout protection
Additional verification for sensitive operations
Database Implementation
I integrated PostgreSQL into my authentication system, which was a practical choice given my existing SQL license couldn't work for this project. This database is handling all user data, authentication records, and session management effectively.
Current State and Next Steps
The authentication system is now functional with:
Complete signup and login flows
Working role-based access control
Google authentication integration
JWT token system implementation
My next steps will focus on:
Adding additional security features
Implementing more robust farmer-focused accessibility options
Expanding the authentication options for experts and administrators
Adding more comprehensive audit logging.
Challenges Faced
One of my main challenges was balancing security with accessibility, especially for farmer users. While a four-digit PIN isn't typically recommended for security reasons, I implemented additional safeguards to protect these accounts while maintaining ease of use.
The integration of multiple authentication methods (local PIN-based, Google OAuth, and standard password-based) required careful planning to ensure all systems worked together seamlessly.
Technical Decisions
Throughout this implementation, I made several key technical choices:
Used Onion Architecture for clean separation of concerns
Implemented MediatR for better command and query handling
Chose PostgreSQL for its robust features and licensing compatibility
Integrated Microsoft Identity for flexible user management
Added Google authentication for additional login options
Looking Forward
While the basic authentication system is now in place, I plan to continue improving it by:
Adding more security features for sensitive operations
Implementing additional accessibility options
Expanding audit logging capabilities
Adding more authentication providers
Work On courses and modules with all their dependent functionalities.
The current implementation provides a solid foundation for these future improvements while meeting our immediate needs for user authentication and access control.
Conclusion
This week's work has resulted in a functional authentication system that serves our diverse user base. While there's still room for improvement, the current implementation successfully balances security requirements with accessibility needs, particularly for our farmer users.
Top comments (2)
great progress so far!
Great to see the progress