T412023 - Oauth implementation
Add OAuth Authentication for Wikidata Editing Implements OAuth 1.0a authentication with Wikimedia to enable users to login and prepare for future Wikidata editing features (adding/editing authors and works).
Changes
- Authentication & Authorization
- OAuth 1.0a Integration
- Implemented OAuth flow using mwoauth library
- Added login route (/auth/login) to initiate OAuth handshake
- Added callback route (/oauth-callback) to handle Wikimedia redirects
- Added logout route (/auth/logout) to clear user session
- Session-based token storage (access tokens stored securely in Flask session)
- User Session Management
- Store Wikimedia username and user ID in session after successful authentication
- Persist session across page navigation
- Clear all OAuth data on logout
- Updated new translatable strings
- Updated Config-sample.py with new token fields required for Oauth
- Updated README.md with OAuth configuration section on how to test and work with Oauth Login flow locally.
- Added new dependencies to requirements.txt: mwoauth and flask-limiter
User Interface
- Added login button for unauthenticated users
- Added user dropdown for authenticated users showing: -Username with profile icon -Logout option
- Created oauth-callback.html template: -Shows loading spinner and "Authenticating with Wikimedia..." message -Provides user feedback during OAuth handshake
Rate Limiting
- Implemented Flask-Limiter
- Global rate limits: 200 requests/day, 50 requests/hour
- Login endpoint: 5 attempts/minute
- User-specific tracking: Uses Wikimedia user ID when authenticated, IP address when not
- Rate Limiting Configuration - Uses in-memory for development
- Rate Limit Error Handling

